func (q *Query) SearchThreads() (*Threads, error) { threads := &Threads{query: q} cthreads := (**C.notmuch_threads_t)(unsafe.Pointer(&threads.cptr)) cerr := C.notmuch_query_search_threads_st(q.toC(), cthreads) err := statusErr(cerr) if err != nil { return nil, err } runtime.SetFinalizer(threads, func(t *Threads) { C.notmuch_threads_destroy(t.toC()) }) return threads, nil }
/* Destroy a notmuch_threads_t object. * * It's not strictly necessary to call this function. All memory from * the notmuch_threads_t object will be reclaimed when the * containg query object is destroyed. */ func (self *Threads) Destroy() { if self.threads != nil { C.notmuch_threads_destroy(self.threads) } }
func (ts *Threads) Close() error { return (*cStruct)(ts).doClose(func() error { C.notmuch_threads_destroy(ts.toC()) return nil }) }