prevent buffer destroy race

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13219 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-05-01 21:31:16 +00:00
parent e9c8418a89
commit fae50b4197
2 changed files with 10 additions and 1 deletions
+7 -1
View File
@@ -879,9 +879,15 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, s
switch_mutex_unlock(session->resample_mutex);
/* clear indications */
switch_core_session_flush_message(session);
/* wipe these, they will be recreated if need be */
switch_buffer_destroy(&session->raw_read_buffer);
switch_mutex_lock(session->codec_write_mutex);
switch_buffer_destroy(&session->raw_write_buffer);
switch_mutex_unlock(session->codec_write_mutex);
switch_mutex_lock(session->codec_read_mutex);
switch_buffer_destroy(&session->raw_read_buffer);
switch_mutex_unlock(session->codec_read_mutex);
if (flush_dtmf) {
while ((has = switch_channel_has_dtmf(channel))) {