diff options
author | Steve Bennett <steveb@workware.net.au> | 2013-08-02 08:42:11 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2013-08-02 08:44:05 +1000 |
commit | a9fe2942a09523c248e64d080f8e3b38d3a34f19 (patch) | |
tree | 5be808a32bb42f3ec98cdfb6e8d8b647b462651d /jim-aio.c | |
parent | 7c126ab08220024b7dfe293045e6ee4d0bb3ca95 (diff) | |
download | jimtcl-a9fe2942a09523c248e64d080f8e3b38d3a34f19.zip jimtcl-a9fe2942a09523c248e64d080f8e3b38d3a34f19.tar.gz jimtcl-a9fe2942a09523c248e64d080f8e3b38d3a34f19.tar.bz2 |
Correct file handler should be deleted
Previously, Jim_DeleteFileHandler() would indiscriminately
delete the first matching file handler in the list.
Instead, it should delete the file handler matching the event mask.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-aio.c')
-rw-r--r-- | jim-aio.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -292,16 +292,8 @@ static void JimAioDelProc(Jim_Interp *interp, void *privData) Jim_DecrRefCount(interp, af->filename); #ifdef jim_ext_eventloop - /* remove existing EventHandlers */ - if (af->rEvent) { - Jim_DeleteFileHandler(interp, af->fp); - } - if (af->wEvent) { - Jim_DeleteFileHandler(interp, af->fp); - } - if (af->eEvent) { - Jim_DeleteFileHandler(interp, af->fp); - } + /* remove all existing EventHandlers */ + Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION); #endif Jim_Free(af); } @@ -810,7 +802,7 @@ static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Ob if (*scriptHandlerObj) { /* Delete old handler */ - Jim_DeleteFileHandler(interp, af->fp); + Jim_DeleteFileHandler(interp, af->fp, mask); *scriptHandlerObj = NULL; } |