Ejemplo n.º 1
0
func (t *Threads) Get() *Thread {
	cthread := C.notmuch_threads_get(t.toC())
	// NOTE: we don't distinguish between OOM and calling Get when
	// !t.Valid(). As such, it's an error for the user to call Get
	// without first calling Valid.
	checkOOM(unsafe.Pointer(cthread))
	thread := &Thread{
		cptr:    cthread,
		threads: t,
	}
	runtime.SetFinalizer(thread, func(t *Thread) {
		C.notmuch_thread_destroy(t.toC())
	})
	return thread
}
Ejemplo n.º 2
0
func (t *Thread) Close() error {
	return (*cStruct)(t).doClose(func() error {
		C.notmuch_thread_destroy(t.toC())
		return nil
	})
}
Ejemplo n.º 3
0
/**
 * Destroy a notmuch_thread_t object.
 */
func (self *Thread) Destroy() {
	if self.thread != nil {
		C.notmuch_thread_destroy(self.thread)
	}
}