}
/* wait until next event */
- for (;;) {
+ while (count > 0) {
int timeout = blocking ? INFINITE : 0;
int ret = WaitForMultipleObjects(count, events, FALSE, timeout);
g_free(tmp);
}
}
+
+ /* Try again, but only call each handler once. */
+ events[ret - WAIT_OBJECT_0] = events[--count];
}
return progress;