From 3909d249312c2bdaa69beb1410e577eabef387ce Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 19 Dec 2010 00:53:19 +0500 Subject: util.events: Remove an event's table when it has no more handlers. --- util/events.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/events.lua b/util/events.lua index 8e05072d..412acccd 100644 --- a/util/events.lua +++ b/util/events.lua @@ -45,6 +45,9 @@ function new() if map then map[handler] = nil; handlers[event] = nil; + if next(map) == nil then + event_map[event] = nil; + end end end; local function add_handlers(handlers) -- cgit v1.2.3