Mon Mar 9 12:44:03 CDT 2009 Pekka Pessi <first.last@nokia.com>

* 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
This commit is contained in:
Michael Jerris 2009-03-24 15:42:53 +00:00
parent 39ed058e2a
commit 596a0b60cb
2 changed files with 5 additions and 6 deletions

View File

@ -1 +1 @@
Tue Mar 24 10:41:20 CDT 2009
Tue Mar 24 10:41:57 CDT 2009

View 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);