summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-05-04 09:25:35 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-05-04 09:25:35 -0500
commit81c27127aafdd6547c5fd46f620057c0544e33e7 (patch)
treec3c57e2d70faa351c755ab5fcf2c02f63cb71b68
parent743fed71fc4a0c94a569bbc247e9cedd074d8ab8 (diff)
parentf38066fcad559da3f214b4d309dcc4b070665d66 (diff)
Merge "Format Interfaces: Prevent unload except by shutdown." into 13
-rw-r--r--main/format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/format.c b/main/format.c
index 3e1ee866e..148c77f8d 100644
--- a/main/format.c
+++ b/main/format.c
@@ -36,6 +36,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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 @@ int __ast_format_interface_register(const char *codec, const struct ast_format_i
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);