From 19d8a3e3ac680606fd4fc3b09513b5c9869db92c Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 29 Oct 2007 22:15:42 +0000 Subject: [PATCH] don't destroy a mutex we are still using git-svn-id: http://svn.openzap.org/svn/openzap/trunk@314 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/zap_io.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/openzap/src/zap_io.c b/libs/openzap/src/zap_io.c index 951f7424d7..fe0c0a6d07 100644 --- a/libs/openzap/src/zap_io.c +++ b/libs/openzap/src/zap_io.c @@ -323,10 +323,6 @@ zap_status_t zap_span_close_all(void) zap_channel_destroy(&span->channels[i]); } - if (span->mutex) { - zap_mutex_destroy(&span->mutex); - } - zap_safe_free(span->signal_data); } zap_mutex_unlock(globals.mutex); @@ -1945,6 +1941,7 @@ zap_status_t zap_global_destroy(void) if (zap_test_flag(cur_span, ZAP_SPAN_CONFIGURED)) { zap_mutex_lock(cur_span->mutex); + zap_clear_flag(cur_span, ZAP_SPAN_CONFIGURED); for(j = 1; j <= cur_span->chan_count; j++) { zap_channel_t *cur_chan = &cur_span->channels[j]; if (zap_test_flag(cur_chan, ZAP_CHANNEL_CONFIGURED)) { @@ -1952,6 +1949,10 @@ zap_status_t zap_global_destroy(void) } } zap_mutex_unlock(cur_span->mutex); + + if (cur_span->mutex) { + zap_mutex_destroy(&cur_span->mutex); + } } }