]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Mon Mar 9 12:44:03 CDT 2009 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Tue, 24 Mar 2009 15:42:53 +0000 (15:42 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 24 Mar 2009 15:42:53 +0000 (15:42 +0000)
  * su_alloc: shorten race on _su_deinit()
  Ignore-this: 6d4e6edb434a96e66c9bb018a201a3c6

  Make home object unusable earlier during denitialization.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12745 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c

index 67dad1d32712c49505bbd0f00ee45898dabff3b1..4a0e22fd626a6785bae15e549ae2d69de88fc835 100644 (file)
@@ -1 +1 @@
-Tue Mar 24 10:41:20 CDT 2009
+Tue Mar 24 10:41:57 CDT 2009
index 075bd77e958ce7ecd8609f4bb99d6b10bf38b55f..2d399b363353b4899318b7844ce46a2b50e67977 100644 (file)
@@ -993,6 +993,9 @@ void _su_home_deinit(su_home_t *home)
   if (home->suh_blocks) {
     size_t i;
     su_block_t *b;
+    void *suh_lock = home->suh_lock;
+
+    home->suh_lock = NULL;
 
      if (home->suh_blocks->sub_destructor) {
       void (*destructor)(void *) = home->suh_blocks->sub_destructor;
@@ -1034,11 +1037,7 @@ void _su_home_deinit(su_home_t *home)
 
     home->suh_blocks = NULL;
 
-    if (home->suh_lock) {
-      void *suh_lock = home->suh_lock;
-
-      home->suh_lock = NULL;
-
+    if (suh_lock) {
       /* Unlock, or risk assert() or leak handles on Windows */
       _su_home_unlocker(suh_lock);
       _su_home_destroy_mutexes(suh_lock);