summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorSteve Murphy <murf@digium.com>2007-11-21 23:54:12 +0000
committerSteve Murphy <murf@digium.com>2007-11-21 23:54:12 +0000
commit86476c607f9b636046b39c7913edf75b850f6517 (patch)
tree0dc51f470ca68136426e22f709f308185e6121c2 /res
parent7e8835e0d79b129fe07a5f1a67aee35548e616cd (diff)
closes issue #11285, where an unload of a module that creates a dialplan context, causes a crash when you do a 'dialplan show' of that context. This is because the registrar string is defined in the module, and the stale pointer is traversed. The reporter offered a patch that would always strdup the registrar string, which is practical, but I preferred to destroy the created contexts in each module where one is created. That seemed more symmetric. There were only 6 place in asterisk where this is done: chan_sip, chan_iax2, chan_skinny, res_features, app_dial, and app_queue. The two apps destroyed the context, but left the contexts. All is fixed now and unloads should be dialplan friendly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_features.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/res/res_features.c b/res/res_features.c
index 8bb8e5f38..31ce64b1a 100644
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -3305,6 +3305,7 @@ static int load_module(void)
static int unload_module(void)
{
+ struct ast_context *con;
ast_manager_unregister("ParkedCalls");
ast_manager_unregister("Bridge");
ast_manager_unregister("Park");
@@ -3312,6 +3313,12 @@ static int unload_module(void)
ast_unregister_application(parkcall);
ast_unregister_application(app_bridge);
ast_devstate_prov_del("Park");
+ con = ast_context_find(parking_con);
+ if (con)
+ ast_context_destroy(con, registrar);
+ con = ast_context_find(parking_con_dial);
+ if (con)
+ ast_context_destroy(con, registrar);
return ast_unregister_application(parkedcall);
}