[Asterisk-code-review] res stasis: Fix dial bridge unload. (asterisk[15])

Jenkins2 asteriskteam at digium.com
Tue Jan 9 06:56:11 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7869 )

Change subject: res_stasis: Fix dial bridge unload.
......................................................................

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
---
M res/res_stasis.c
M res/stasis/control.c
2 files changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_stasis.c b/res/res_stasis.c
index 42a19bf..1f5296d 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1992,6 +1992,9 @@
 	messaging_cleanup();
 
 	cleanup();
+
+	stasis_app_control_shutdown();
+
 	ao2_cleanup(apps_registry);
 	apps_registry = NULL;
 
@@ -2006,8 +2009,6 @@
 
 	ao2_cleanup(app_bridges_playback);
 	app_bridges_playback = NULL;
-
-	stasis_app_control_shutdown();
 
 	STASIS_MESSAGE_TYPE_CLEANUP(end_message_type);
 	STASIS_MESSAGE_TYPE_CLEANUP(start_message_type);
diff --git a/res/stasis/control.c b/res/stasis/control.c
index 314d68a..8199e46 100644
--- a/res/stasis/control.c
+++ b/res/stasis/control.c
@@ -1507,7 +1507,9 @@
 {
 	ast_mutex_lock(&dial_bridge_lock);
 	shutting_down = 1;
-	ao2_cleanup(dial_bridge);
-	dial_bridge = NULL;
+	if (dial_bridge) {
+		ast_bridge_destroy(dial_bridge, 0);
+		dial_bridge = NULL;
+	}
 	ast_mutex_unlock(&dial_bridge_lock);
 }

-- 
To view, visit https://gerrit.asterisk.org/7869
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I372302de94ca63876069e2585a049c5060e5e767
Gerrit-Change-Number: 7869
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180109/de846322/attachment-0001.html>


More information about the asterisk-code-review mailing list