summaryrefslogtreecommitdiff
path: root/main/codec.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-02-21 02:56:59 +0000
committerCorey Farrell <git@cfware.com>2015-02-21 02:56:59 +0000
commit93c9c3af2f63f7f25dc24220066f2e667761e78f (patch)
tree409ec7e096c812fb50b922afabb6ad27eda305ba /main/codec.c
parent54a699fb64dfb75a921146c40e507c917457b3b6 (diff)
Allow shutdown to unload modules that register bucket scheme's or codec's.
* Change __ast_module_shutdown_ref to be NULL safe (11+). * Allow modules that call ast_bucket_scheme_register or ast_codec_register to be unloaded during graceful shutdown only (13+ only). ASTERISK-24796 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4428/ ........ Merged revisions 432058 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/codec.c')
-rw-r--r--main/codec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/codec.c b/main/codec.c
index 19e78fa67..45f2edf2b 100644
--- a/main/codec.c
+++ b/main/codec.c
@@ -296,8 +296,8 @@ int __ast_codec_register(struct ast_codec *codec, struct ast_module *mod)
ao2_link_flags(codecs, codec_new, OBJ_NOLOCK);
- /* Once registered a codec can not be unregistered, and the module must persist */
- ast_module_ref(mod);
+ /* Once registered a codec can not be unregistered, and the module must persist until shutdown */
+ ast_module_shutdown_ref(mod);
ast_verb(2, "Registered '%s' codec '%s' at sample rate '%u' with id '%u'\n",
ast_codec_media_type2str(codec->type), codec->name, codec->sample_rate, codec_new->id);