FS-11823 [core] clear out event queue when destroying session

This commit is contained in:
Chris Rienzo 2019-04-30 18:50:34 +00:00 committed by Mike Jerris
parent 20e370aa2a
commit 2d231cdff3

View File

@ -1580,6 +1580,17 @@ SWITCH_DECLARE(void) switch_core_session_perform_destroy(switch_core_session_t *
}
}
if ((*session)->event_queue) {
switch_status_t status;
void *pop;
while ((status = (switch_status_t) switch_queue_trypop((*session)->event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
if (pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_destroy(&event);
}
}
}
pool = (*session)->pool;
//#ifndef NDEBUG
//memset(*session, 0, sizeof(switch_core_session_t));