Software /
code /
prosody
Changeset
4696:4700e318add1
mod_http: Use module:hook/unhook_event_object() so that handlers get unregistered if mod_http is unloaded
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 26 Apr 2012 05:40:04 +0100 |
parents | 4695:838ad61c6b2c |
children | 4697:778eb9405a98 |
files | plugins/mod_http.lua |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_http.lua Thu Apr 26 05:39:27 2012 +0100 +++ b/plugins/mod_http.lua Thu Apr 26 05:40:04 2012 +0100 @@ -57,7 +57,7 @@ end if not app_handlers[event_name] then app_handlers[event_name] = handler; - server.add_handler(event_name, handler); + module:hook_object_event(server, event_name, handler); else module:log("warn", "App %s added handler twice for '%s', ignoring", app_name, event_name); end @@ -71,7 +71,7 @@ local app_handlers = apps[event.item.name]; apps[event.item.name] = nil; for event, handler in pairs(app_handlers) do - server.remove_handler(event, handler); + module:unhook_object_event(server, event, handler); end end