]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_queue: Fix crash when unloading module. 07/2707/1
authorJoshua Colp <jcolp@digium.com>
Tue, 26 Apr 2016 10:48:40 +0000 (07:48 -0300)
committerJoshua Colp <jcolp@digium.com>
Tue, 26 Apr 2016 11:16:05 +0000 (06:16 -0500)
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

apps/app_queue.c

index a13af8bdb1785e381b03f1abd3e151603bda7d97..3d7e6d5f20d44d031baa9ffb6da6551fb2c643b8 100644 (file)
@@ -10854,8 +10854,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;
 }