From: Automerge script Date: Thu, 30 Aug 2012 21:24:42 +0000 (+0000) Subject: Merged revisions 372090 via svnmerge from X-Git-Tag: 10.9.0-digiumphones-rc1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1db640cdbcdd6cb5da6344e2bfc1ddcf3ecf1303;p=thirdparty%2Fasterisk.git Merged revisions 372090 via svnmerge from file:///srv/subversion/repos/asterisk/branches/10 ................ r372090 | mmichelson | 2012-08-30 15:53:09 -0500 (Thu, 30 Aug 2012) | 17 lines Prevent crash on shutdown due to refcount error on queues container. When app_queue is unloaded, the queues container has its refcount decremented, potentially to 0. Then the taskprocessor responsible for handling device state changes is unreferenced. If the taskprocessor happens to be just about to run its task, then it will create and destroy an iterator on the queues container. This can cause the refcount on the queues container to increase to 1 and then back to 0. Going back to 0 a second time results in double frees. This failure was seen periodically in the testsuite when Asterisk would shut down. ........ Merged revisions 372089 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@372115 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 8668140290..90f1a5e9ab 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -8669,8 +8669,8 @@ static int unload_module(void) queue_t_unref(q, "Done with iterator"); } ao2_iterator_destroy(&q_iter); - ao2_ref(queues, -1); devicestate_tps = ast_taskprocessor_unreference(devicestate_tps); + ao2_ref(queues, -1); ast_unload_realtime("queue_members"); return res; }