diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-19 22:32:40 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-03-19 22:32:40 +0000 |
commit | 1e147049a565dadc4ab65554a2e3e16a10ca7d4c (patch) | |
tree | 6847c46873d28bd50374012e82d94519bc1fcc18 | |
parent | 86eb621b924b5f829a0048791946d981d11cb0ad (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@59051 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/loader.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/loader.c b/main/loader.c index 838bcd27b..ebad7fda6 100644 --- a/main/loader.c +++ b/main/loader.c @@ -475,6 +475,9 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f AST_LIST_UNLOCK(&module_list); + if (!error && !mod->lib) + mod->info->restore_globals(); + #if LOADABLE_MODULES if (!error) unload_dynamic_module(mod); @@ -483,9 +486,6 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f if (!error) ast_update_use_count(); - if (!error && !mod->lib) - mod->info->restore_globals(); - return res; } |