diff --git a/WINGs/wevent.c b/WINGs/wevent.c index 9656ddaa..488d611a 100644 --- a/WINGs/wevent.c +++ b/WINGs/wevent.c @@ -902,6 +902,7 @@ W_WaitForEvent(Display *dpy, unsigned long xeventmask) if ((handler->mask & WIExceptMask) && FD_ISSET(handler->fd, &eset)) mask |= WIExceptMask; + /* save it because the handler may remove itself! */ next = handler->next; if (mask!=0 && handler->callback) { diff --git a/WINGs/wutil.c b/WINGs/wutil.c index 92cb1a7e..10e077f7 100644 --- a/WINGs/wutil.c +++ b/WINGs/wutil.c @@ -543,6 +543,7 @@ handleInputEvents(Bool waitForInput) if ((handler->mask & WIExceptMask) && FD_ISSET(handler->fd, &eset)) mask |= WIExceptMask; + /* save it because the handler may remove itself! */ next = handler->next; if (mask!=0 && handler->callback) {