Diff

core/moduleapi.lua @ 6654:22a7ee3379bc

moduleapi: Clear self.event_handlers when unhooking an event, to prevent leaks
author Matthew Wild <mwild1@gmail.com>
date Wed, 06 May 2015 19:01:16 +0100
parent 6653:8241eac507c3
child 6655:a99ed5f5f709
line wrap: on
line diff
--- a/core/moduleapi.lua	Wed May 06 19:00:05 2015 +0100
+++ b/core/moduleapi.lua	Wed May 06 19:01:16 2015 +0100
@@ -94,6 +94,7 @@
 end
 
 function api:unhook_object_event(object, event, handler)
+	self.event_handlers:set(object, event, handler, nil);
 	return object.remove_handler(event, handler);
 end