Changeset

1986:d4ba9d94eb74

modulemanager: Slightly rearranged code for more robust unloading of modules.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 17 Oct 2009 23:48:30 +0500
parents 1985:9b352c8a32e6
children 1987:94ecd3e7be87
files core/modulemanager.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/modulemanager.lua	Sat Oct 17 23:46:34 2009 +0500
+++ b/core/modulemanager.lua	Sat Oct 17 23:48:30 2009 +0500
@@ -170,7 +170,6 @@
 			log("warn", "Non-fatal error unloading module '%s' on '%s': %s", name, host, err);
 		end
 	end
-	modulemap[host][name] = nil;
 	local params = handler_table:get(host, name); -- , {module.host, origin_type, tag, xmlns}
 	for _, param in pairs(params or NULL) do
 		local handlers = stanza_handlers:get(param[1], param[2], param[3], param[4]);
@@ -187,6 +186,7 @@
 		end
 	end
 	hooks:remove(host, name);
+	modulemap[host][name] = nil;
 	return true;
 end