mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
res_stasis: Fix dial bridge unload.
If the dial bridge has been created it must be released by calling ast_bridge_destroy, simply releasing the ao2 reference is not enough. Also move stasis_app_control_shutdown earlier in unload to ensure the bridge cannot be created or grabbed after the app_bridges container is released. Change-Id: I372302de94ca63876069e2585a049c5060e5e767
This commit is contained in:
@@ -1992,6 +1992,9 @@ static int unload_module(void)
|
|||||||
messaging_cleanup();
|
messaging_cleanup();
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
|
stasis_app_control_shutdown();
|
||||||
|
|
||||||
ao2_cleanup(apps_registry);
|
ao2_cleanup(apps_registry);
|
||||||
apps_registry = NULL;
|
apps_registry = NULL;
|
||||||
|
|
||||||
@@ -2007,8 +2010,6 @@ static int unload_module(void)
|
|||||||
ao2_cleanup(app_bridges_playback);
|
ao2_cleanup(app_bridges_playback);
|
||||||
app_bridges_playback = NULL;
|
app_bridges_playback = NULL;
|
||||||
|
|
||||||
stasis_app_control_shutdown();
|
|
||||||
|
|
||||||
STASIS_MESSAGE_TYPE_CLEANUP(end_message_type);
|
STASIS_MESSAGE_TYPE_CLEANUP(end_message_type);
|
||||||
STASIS_MESSAGE_TYPE_CLEANUP(start_message_type);
|
STASIS_MESSAGE_TYPE_CLEANUP(start_message_type);
|
||||||
|
|
||||||
|
@@ -1544,7 +1544,9 @@ void stasis_app_control_shutdown(void)
|
|||||||
{
|
{
|
||||||
ast_mutex_lock(&dial_bridge_lock);
|
ast_mutex_lock(&dial_bridge_lock);
|
||||||
shutting_down = 1;
|
shutting_down = 1;
|
||||||
ao2_cleanup(dial_bridge);
|
if (dial_bridge) {
|
||||||
dial_bridge = NULL;
|
ast_bridge_destroy(dial_bridge, 0);
|
||||||
|
dial_bridge = NULL;
|
||||||
|
}
|
||||||
ast_mutex_unlock(&dial_bridge_lock);
|
ast_mutex_unlock(&dial_bridge_lock);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user