[Asterisk-code-review] Format Interfaces: Prevent unload except by shutdown. (asterisk[master])
Corey Farrell
asteriskteam at digium.com
Sun May 3 21:09:41 CDT 2015
Corey Farrell has uploaded a new change for review.
https://gerrit.asterisk.org/352
Change subject: Format Interfaces: Prevent unload except by shutdown.
......................................................................
Format Interfaces: Prevent unload except by shutdown.
Format interfaces cannot be unregistered, so the modules that provide them
need to be held open except by shutdown.
ASTERISK-25054 #close
Reported by: Corey Farrell
Change-Id: Iadbd9675bf0d30b8fded5a739b163db3ea2db8f3
---
M main/format.c
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/352/1
diff --git a/main/format.c b/main/format.c
index 8fed71f..bbfb697 100644
--- a/main/format.c
+++ b/main/format.c
@@ -36,6 +36,7 @@
#include "asterisk/format.h"
#include "asterisk/astobj2.h"
#include "asterisk/strings.h"
+#include "asterisk/module.h"
/*! \brief Number of buckets to use for format interfaces (should be prime for performance reasons) */
#define FORMAT_INTERFACE_BUCKETS 53
@@ -156,6 +157,8 @@
format_interface->interface = interface;
strcpy(format_interface->codec, codec); /* Safe */
+ /* Once registered a format interface cannot be unregistered. */
+ ast_module_shutdown_ref(mod);
ao2_link_flags(interfaces, format_interface, OBJ_NOLOCK);
ao2_ref(format_interface, -1);
--
To view, visit https://gerrit.asterisk.org/352
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadbd9675bf0d30b8fded5a739b163db3ea2db8f3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
More information about the asterisk-code-review
mailing list