diff options
author | Ali Polatel <alip@exherbo.org> | 2010-05-26 20:56:07 +0300 |
---|---|---|
committer | Ali Polatel <alip@exherbo.org> | 2010-06-06 09:18:00 +0300 |
commit | 5c9e385591b66fa20cbb186393c48c52831a23b7 (patch) | |
tree | 2c87c8356373a958623e65ef311054799f09e5ea /bindings/ruby/threads.c | |
parent | d2a457a5d8238c54445a8a6066f79c112ebd3a04 (diff) |
ruby: Don't barf if an object is destroyed more than once
Raise RuntimeError instead.
Also revise Notmuch::Database a bit.
Add Notmuch::Database.open singleton method.
Diffstat (limited to 'bindings/ruby/threads.c')
-rw-r--r-- | bindings/ruby/threads.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bindings/ruby/threads.c b/bindings/ruby/threads.c index 0990697..abd5121 100644 --- a/bindings/ruby/threads.c +++ b/bindings/ruby/threads.c @@ -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); |