aboutsummaryrefslogtreecommitdiffstats
path: root/util/events.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-19 00:53:19 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-19 00:53:19 +0500
commit3909d249312c2bdaa69beb1410e577eabef387ce (patch)
treeae8b20ff32b8aea2ce2c7e9feb174e52e4236f32 /util/events.lua
parent22a83d733c206006fbcf24baaec0e197ed4a3e57 (diff)
downloadprosody-3909d249312c2bdaa69beb1410e577eabef387ce.tar.gz
prosody-3909d249312c2bdaa69beb1410e577eabef387ce.zip
util.events: Remove an event's table when it has no more handlers.
Diffstat (limited to 'util/events.lua')
-rw-r--r--util/events.lua3
1 files changed, 3 insertions, 0 deletions
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)