--- src/NextEvent.c.orig 2006-07-12 03:05:55.000000000 +0900 +++ src/NextEvent.c 2009-02-14 17:22:36.000000000 +0900 @@ -722,7 +722,14 @@ #endif return dpy_no; } - goto WaitLoop; + if (block) + goto WaitLoop; + else { +#ifdef USE_POLL + XtStackFree ((XtPointer) wf.fdlist, fdlist); +#endif + return -1; + } } #define IeCallProc(ptr) \