Merge "res_smdi: Fix shutdown ref."
authorJenkins2 <jenkins2@gerrit.asterisk.org>
Fri, 15 Dec 2017 18:24:43 +0000 (12:24 -0600)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Fri, 15 Dec 2017 18:24:43 +0000 (12:24 -0600)
res/res_smdi.c

index 054e6aa..612a4b8 100644 (file)
@@ -1405,6 +1405,9 @@ static int load_module(void)
        ast_custom_function_register(&smdi_msg_retrieve_function);
        ast_custom_function_register(&smdi_msg_function);
 
+       /* For Optional API. */
+       ast_module_shutdown_ref(AST_MODULE_SELF);
+
        return AST_MODULE_LOAD_SUCCESS;
 }
 
@@ -1434,9 +1437,6 @@ static int _unload_module(int fromload)
 
        smdi_loaded = 0;
 
-       /* For Optional API. */
-       ast_module_shutdown_ref(AST_MODULE_SELF);
-
        return 0;
 }