Skip to content
Snippets Groups Projects
Commit b400d50b authored by Kevin Harwell's avatar Kevin Harwell Committed by Gerrit Code Review
Browse files

Merge "res_odbc: Allow unload at shutdown."

parents 00563ce2 eb34b881
Branches
Tags
No related merge requests found
...@@ -996,17 +996,25 @@ static int reload(void) ...@@ -996,17 +996,25 @@ static int reload(void)
static int unload_module(void) static int unload_module(void)
{ {
/* Prohibit unloading */ ao2_cleanup(class_container);
return -1; ast_cli_unregister_multiple(cli_odbc, ARRAY_LEN(cli_odbc));
return 0;
} }
static int load_module(void) static int load_module(void)
{ {
if (!(class_container = ao2_container_alloc(1, null_hash_fn, ao2_match_by_addr))) if (!(class_container = ao2_container_alloc(1, null_hash_fn, ao2_match_by_addr))) {
return AST_MODULE_LOAD_DECLINE; return AST_MODULE_LOAD_DECLINE;
if (load_odbc_config() == -1) }
if (load_odbc_config() == -1) {
return AST_MODULE_LOAD_DECLINE; return AST_MODULE_LOAD_DECLINE;
}
ast_module_shutdown_ref(ast_module_info->self);
ast_cli_register_multiple(cli_odbc, ARRAY_LEN(cli_odbc)); ast_cli_register_multiple(cli_odbc, ARRAY_LEN(cli_odbc));
return AST_MODULE_LOAD_SUCCESS; return AST_MODULE_LOAD_SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment