diff options
author | Thomas Harning Jr <harningt@gmail.com> | 2007-09-06 00:05:55 -0400 |
---|---|---|
committer | Thomas Harning Jr <harningt@gmail.com> | 2007-09-06 00:05:55 -0400 |
commit | 64a4223203928443ee5a49dbb7579e1db53a4056 (patch) | |
tree | 8eb5f119e98e57e75186c4b1c4bc7cb23503337b /src | |
parent | 35c12fdb05ee081794f621688bb299a9a63ebf2c (diff) | |
download | luaevent-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.c | 8 |
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); |