mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-24 04:04:16 +00:00
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:
1 parent
ffb2e317bb
commit
2f94f73921
15 files changed
+98
-28
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user