From 596a0b60cbd972f79e258ef99ef96297c355e1f4 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 24 Mar 2009 15:42:53 +0000 Subject: [PATCH] Mon Mar 9 12:44:03 CDT 2009 Pekka Pessi * 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 | 2 +- libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 67dad1d327..4a0e22fd62 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Mar 24 10:41:20 CDT 2009 +Tue Mar 24 10:41:57 CDT 2009 diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c index 075bd77e95..2d399b3633 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c @@ -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);