X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=bindings%2Fruby%2Fthreads.c;h=ccf59f8e9b37a824a90d067b776cc2456f6e6840;hb=191c4ae693c35ecd9e905e64c7619734171c4a8a;hp=09906975f1e84091ead20878a06b96b60e55d0b1;hpb=c7893408bbe6904ae7da97aa203587af4ec2fac7;p=notmuch diff --git a/bindings/ruby/threads.c b/bindings/ruby/threads.c index 09906975..ccf59f8e 100644 --- a/bindings/ruby/threads.c +++ b/bindings/ruby/threads.c @@ -21,7 +21,7 @@ #include "defs.h" /* - * call-seq: THREADS.destroy => nil + * call-seq: THREADS.destroy! => nil * * Destroys the threads, freeing all resources allocated for it. */ @@ -33,11 +33,11 @@ notmuch_rb_threads_destroy(VALUE self) Data_Get_Struct(self, notmuch_threads_t, threads); notmuch_threads_destroy(threads); + DATA_PTR(self) = NULL; return Qnil; } - /* call-seq: THREADS.each {|item| block } => THREADS * * Calls +block+ once for each thread in +self+, passing that element as a @@ -49,9 +49,7 @@ notmuch_rb_threads_each(VALUE self) notmuch_thread_t *thread; notmuch_threads_t *threads; - Data_Get_Struct(self, notmuch_threads_t, threads); - if (!threads) - return self; + Data_Get_Notmuch_Threads(self, threads); for (; notmuch_threads_valid(threads); notmuch_threads_move_to_next(threads)) { thread = notmuch_threads_get(threads);