# HG changeset patch # User Waqas Hussain # Date 1292701999 -18000 # Node ID bc4f67a0658dc77ea70d6c649a61f12a5fa0b67a # Parent f3f2a78101085689cd0fec7c41b3dfdae9cb4d09 util.events: Remove an event's table when it has no more handlers. diff -r f3f2a7810108 -r bc4f67a0658d util/events.lua --- a/util/events.lua Sat Dec 18 14:46:28 2010 +0000 +++ b/util/events.lua Sun Dec 19 00:53:19 2010 +0500 @@ -45,6 +45,9 @@ 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)