Revision
3120
Author
lsansonetti@apple.com
Date
2009-12-14 18:10:31 -0800 (Mon, 14 Dec 2009)

Log Message

don't try to release a NULL semaphore

Modified Paths

Diff

Modified: MacRuby/trunk/gcd.c (3119 => 3120)


--- MacRuby/trunk/gcd.c	2009-12-15 02:07:02 UTC (rev 3119)
+++ MacRuby/trunk/gcd.c	2009-12-15 02:10:31 UTC (rev 3120)
@@ -874,7 +874,9 @@
 static void
 rb_semaphore_finalize(void *rcv, SEL sel)
 {
-    dispatch_release(RSemaphore(rcv)->sem);
+    if (RSemaphore(rcv)->sem != NULL) {
+	dispatch_release(RSemaphore(rcv)->sem);
+    }
     if (rb_semaphore_finalize_super != NULL) {
         ((void(*)(void *, SEL))rb_semaphore_finalize_super)(rcv, sel);
     }