summaryrefslogtreecommitdiff
path: root/main/loader.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/loader.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/loader.c')
-rw-r--r--main/loader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/loader.c b/main/loader.c
index 33b6f7ece..f2f3e234a 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -1484,10 +1484,12 @@ struct ast_module *__ast_module_ref(struct ast_module *mod, const char *file, in
void __ast_module_shutdown_ref(struct ast_module *mod, const char *file, int line, const char *func)
{
- if (!mod->flags.keepuntilshutdown) {
- __ast_module_ref(mod, file, line, func);
- mod->flags.keepuntilshutdown = 1;
+ if (!mod || mod->flags.keepuntilshutdown) {
+ return;
}
+
+ __ast_module_ref(mod, file, line, func);
+ mod->flags.keepuntilshutdown = 1;
}
void __ast_module_unref(struct ast_module *mod, const char *file, int line, const char *func)