aboutsummaryrefslogtreecommitdiffstats
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
commitd08df18e9c6daaf764b3aafff523e2e83c38b4dc (patch)
treef84055b3b555a466de311aa9b69eb7cdf04b0c85
parent3da0331d8aeaa87c7d7924f7d3d3653c1f11047e (diff)
downloadprosody-d08df18e9c6daaf764b3aafff523e2e83c38b4dc.tar.gz
prosody-d08df18e9c6daaf764b3aafff523e2e83c38b4dc.zip
moduleapi: Clear self.event_handlers when unhooking an event, to prevent leaks
-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