projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27e9b58
)
util.timer: When using libevent hold onto the event handle to stop it being collected...
author
Matthew Wild
<mwild1@gmail.com>
Wed, 7 Apr 2010 20:00:20 +0000
(21:00 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 7 Apr 2010 20:00:20 +0000
(21:00 +0100)
util/timer.lua
patch
|
blob
|
history
diff --git
a/util/timer.lua
b/util/timer.lua
index c6bd2748ec20ec0a3e40ac385c46daa8fe91662a..fa1dd7c54cadde12e4bac4aa8a23304ba167bc96 100644
(file)
--- a/
util/timer.lua
+++ b/
util/timer.lua
@@
-55,11
+55,12
@@
if not event then
else
local EVENT_LEAVE = (event.core and event.core.LEAVE) or -1;
function _add_task(delay, func)
- event_base:addevent(nil, 0, function ()
+ local event_handle;
+ event_handle = event_base:addevent(nil, 0, function ()
local ret = func();
if ret then
return 0, ret;
- else
+ else
if event_handle then
return EVENT_LEAVE;
end
end