make modules unbind events and un-reserve subclasses on module unload

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8898 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2008-07-03 23:54:35 +00:00
1 parent ffb2e317bb
commit 2f94f73921
15 files changed
+98 -28

No files matched your search

+4 -1
View File
@@ -80,6 +80,7 @@ static struct {
switch_memory_pool_t *pool;
int auto_reload;
int timeout;
switch_event_node_t *node;
} globals;
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_root, globals.root);
@@ -834,7 +835,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load)
do_load();
if (switch_event_bind(modname, SWITCH_EVENT_RELOADXML, NULL, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
if (switch_event_bind_removable(modname, SWITCH_EVENT_RELOADXML, NULL, event_handler, NULL, &globals.node) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_TERM;
}
@@ -855,6 +856,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load)
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_enum_shutdown)
{
switch_event_unbind(&globals.node);
if (globals.pool) {
switch_core_destroy_memory_pool(&globals.pool);
}