app_queue: Fix crash when unloading module.

When unloading the app_queue module the members in each queue are
destroyed and as part of this they are removed from the pending
members container. Unfortunately a crash would occur as the container
was destroyed before the members were removed.

This change tweaks ordering so the container destruction occurs
after the members are destroyed.

ASTERISK-16115

Change-Id: I48c728668c55aee3d05b751a5d450fb57e87f44b
This commit is contained in:
Joshua Colp 2016-04-26 07:48:40 -03:00
parent 09d588dc2f
commit 8ae69cffef
1 changed files with 2 additions and 1 deletions

View File

@ -10983,8 +10983,9 @@ static int unload_module(void)
ast_extension_state_del(0, extension_state_cb);
ast_unload_realtime("queue_members");
ao2_cleanup(pending_members);
ao2_cleanup(queues);
ao2_cleanup(pending_members);
queues = NULL;
return 0;
}