ast_unregister_application(builtins[x].name);
}
ast_manager_unregister("ShowDialPlan");
+ ast_cli_unregister_multiple(pbx_cli, ARRAY_LEN(pbx_cli));
ast_custom_function_unregister(&exception_function);
ast_custom_function_unregister(&testtime_function);
ast_data_unregister(NULL);
{
int x;
+ ast_register_atexit(unload_pbx);
+
/* Initialize the PBX */
ast_verb(1, "Asterisk PBX Core Initializing\n");
if (!(extension_state_tps = ast_taskprocessor_get("pbx-core", 0))) {
return -1;
}
- ast_register_atexit(unload_pbx);
return 0;
}
return (state_cb->change_cb == change_cb) ? CMP_MATCH | CMP_STOP : 0;
}
-/*! \internal \brief Clean up resources on Asterisk shutdown */
+/*!
+ * \internal
+ * \brief Clean up resources on Asterisk shutdown
+ */
static void pbx_shutdown(void)
{
if (hints) {
ao2_ref(hints, -1);
+ hints = NULL;
}
if (hintdevices) {
ao2_ref(hintdevices, -1);
+ hintdevices = NULL;
}
if (statecbs) {
ao2_ref(statecbs, -1);
+ statecbs = NULL;
}
}
statecbs = ao2_container_alloc(1, NULL, statecbs_cmp);
ast_register_atexit(pbx_shutdown);
+
return (hints && hintdevices && statecbs) ? 0 : -1;
}