FS-4960 --resolve

This commit is contained in:
Anthony Minessale 2012-12-22 22:29:33 -06:00
parent 22efebc301
commit 514f4802c1
1 changed files with 11 additions and 0 deletions

View File

@ -1186,9 +1186,17 @@ SWITCH_DECLARE(uint32_t) switch_core_session_flush_private_events(switch_core_se
if (session->private_event_queue) {
while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue_pri, &pop)) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
x++;
}
while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
x++;
}
check_media(session);
@ -1320,6 +1328,9 @@ SWITCH_DECLARE(void) switch_core_session_perform_destroy(switch_core_session_t *
switch_endpoint_interface_t *endpoint_interface = (*session)->endpoint_interface;
int i;
switch_core_session_flush_private_events(*session);
if (switch_core_session_running(*session) && !switch_test_flag((*session), SSF_DESTROYABLE)) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_core_session_get_uuid(*session), SWITCH_LOG_ERROR,
"Cowardly ignoring an attempt to call destroy on a running session.\n");