aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-05-06 19:01:16 +0100
committerMatthew Wild <mwild1@gmail.com>2015-05-06 19:01:16 +0100
commit343f4f8c29f7c8856f7237c7a3cd16785ee6b86b (patch)
treef84055b3b555a466de311aa9b69eb7cdf04b0c85 /core
parent07fcf555ba90278a318df3a7bdc531cf6c6b9881 (diff)
downloadprosody-343f4f8c29f7c8856f7237c7a3cd16785ee6b86b.tar.gz
prosody-343f4f8c29f7c8856f7237c7a3cd16785ee6b86b.zip
moduleapi: Clear self.event_handlers when unhooking an event, to prevent leaks
Diffstat (limited to 'core')
-rw-r--r--core/moduleapi.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 11d1fdc1..c7fadc27 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -94,6 +94,7 @@ function api:hook_object_event(object, event, handler, priority)
end
function api:unhook_object_event(object, event, handler)
+ self.event_handlers:set(object, event, handler, nil);
return object.remove_handler(event, handler);
end