mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 22:54:18 +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
@@ -95,9 +95,9 @@ static struct {
|
||||
FILE *gOutFile;
|
||||
int stackDummy;
|
||||
JSRuntime *rt;
|
||||
switch_event_node_t *node;
|
||||
} globals;
|
||||
|
||||
|
||||
static JSClass global_class = {
|
||||
"Global", JSCLASS_HAS_PRIVATE,
|
||||
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
|
||||
@@ -3564,7 +3564,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load)
|
||||
return status;
|
||||
}
|
||||
|
||||
if (switch_event_bind(modname, SWITCH_EVENT_MESSAGE_QUERY, SWITCH_EVENT_SUBCLASS_ANY, message_query_handler, NULL)
|
||||
if (switch_event_bind_removable(modname, SWITCH_EVENT_MESSAGE_QUERY, SWITCH_EVENT_SUBCLASS_ANY, message_query_handler, NULL, &globals.node)
|
||||
!= SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
|
||||
return SWITCH_STATUS_GENERR;
|
||||
@@ -3586,6 +3586,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load)
|
||||
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown)
|
||||
{
|
||||
curl_global_cleanup();
|
||||
switch_event_unbind(&globals.node);
|
||||
switch_core_hash_destroy(&module_manager.mod_hash);
|
||||
switch_core_hash_destroy(&module_manager.load_hash);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
Reference in new issue
Block a user