mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
It is possible for mod to become invalid after we unload it (if it's a dynamic module) so move it around a bit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -475,6 +475,9 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f
|
|||||||
|
|
||||||
AST_LIST_UNLOCK(&module_list);
|
AST_LIST_UNLOCK(&module_list);
|
||||||
|
|
||||||
|
if (!error && !mod->lib)
|
||||||
|
mod->info->restore_globals();
|
||||||
|
|
||||||
#if LOADABLE_MODULES
|
#if LOADABLE_MODULES
|
||||||
if (!error)
|
if (!error)
|
||||||
unload_dynamic_module(mod);
|
unload_dynamic_module(mod);
|
||||||
@@ -483,9 +486,6 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f
|
|||||||
if (!error)
|
if (!error)
|
||||||
ast_update_use_count();
|
ast_update_use_count();
|
||||||
|
|
||||||
if (!error && !mod->lib)
|
|
||||||
mod->info->restore_globals();
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user