aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Harning Jr <harningt@gmail.com>2007-09-06 00:05:55 -0400
committerThomas Harning Jr <harningt@gmail.com>2007-09-06 00:05:55 -0400
commit64a4223203928443ee5a49dbb7579e1db53a4056 (patch)
tree8eb5f119e98e57e75186c4b1c4bc7cb23503337b /src
parent35c12fdb05ee081794f621688bb299a9a63ebf2c (diff)
downloadluaevent-prosody-64a4223203928443ee5a49dbb7579e1db53a4056.tar.gz
luaevent-prosody-64a4223203928443ee5a49dbb7579e1db53a4056.zip
Added timertest. Prevented GC-ed events from causing an abort.
Diffstat (limited to 'src')
-rw-r--r--src/event_callback.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/event_callback.c b/src/event_callback.c
index bbcd51c..76a7789 100644
--- a/src/event_callback.c
+++ b/src/event_callback.c
@@ -23,7 +23,13 @@ void luaevent_callback(int fd, short event, void* p) {
lua_State* L;
int ret;
double newTimeout = -1;
- assert(cb && cb->base && cb->base->loop_L);
+ assert(cb);
+ if(!cb->base) {
+ /* Callback has been collected... die */
+ /* TODO: What should really be done here... */
+ return;
+ }
+ assert(cb->base->loop_L);
L = cb->base->loop_L;
lua_rawgeti(L, LUA_REGISTRYINDEX, cb->callbackRef);
lua_pushinteger(L, event);