]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gthr-dce.h (__gthread_objc_mutex_deallocate): Free mutex->backend.
authorJ. David Anglin <dave@hiauly1.hia.nrc.ca>
Wed, 6 Sep 2000 06:55:34 +0000 (06:55 +0000)
committerOvidiu Predescu <ovidiu@gcc.gnu.org>
Wed, 6 Sep 2000 06:55:34 +0000 (06:55 +0000)
2000-09-02  J. David Anglin  <dave@hiauly1.hia.nrc.ca>

* gthr-dce.h (__gthread_objc_mutex_deallocate): Free mutex->backend.

From-SVN: r36182

gcc/gthr-dce.h

index c2c24cdfe3114d460cbe9cdaea3af5d6674e27cf..761b9482c631ecc10a86907d79659bd30b0e2e42 100644 (file)
@@ -294,9 +294,14 @@ __gthread_objc_mutex_allocate(objc_mutex_t mutex)
 static inline int
 __gthread_objc_mutex_deallocate(objc_mutex_t mutex)
 {
-  if (__gthread_active_p ()
-      && pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
-    return -1;
+  if (__gthread_active_p ())
+    {
+      if (pthread_mutex_destroy((pthread_mutex_t *)mutex->backend))
+        return -1;
+
+      objc_free(mutex->backend);
+      mutex->backend = NULL;
+    }
 
   return 0;
 }