projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa53318
)
util.events: Remove an event's table when it has no more handlers.
author
Waqas Hussain
<waqas20@gmail.com>
Sat, 18 Dec 2010 19:53:19 +0000
(
00:53
+0500)
committer
Waqas Hussain
<waqas20@gmail.com>
Sat, 18 Dec 2010 19:53:19 +0000
(
00:53
+0500)
util/events.lua
patch
|
blob
|
history
diff --git
a/util/events.lua
b/util/events.lua
index 8e05072d55d958452638d9862dfcb1bc1853274b..412acccd762cb755a9c0627f2689ea82b5989465 100644
(file)
--- 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)