From c7136a5b2cc9e6da35df23c4f4dfa7d0668e5a28 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 18 May 2012 23:53:02 +0100 Subject: moduleapi, modulemanager: Re-structure module.event_handlers so that the same handler can harmlessly handle multiple events (thanks Zash) --- core/modulemanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/modulemanager.lua') diff --git a/core/modulemanager.lua b/core/modulemanager.lua index b9f221c8..417dedbe 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -91,8 +91,8 @@ local function do_unload_module(host, name) end end - for handler, event in pairs(mod.module.event_handlers) do - event.object.remove_handler(event.name, handler); + for event, data in pairs(mod.module.event_handlers) do + data.object.remove_handler(event, data.handler); end if mod.module.items then -- remove items -- cgit v1.2.3