I thought we'd fixed the cases where this could come up, but
apparently having an event_base_break() happen while processing
signal events could get us in trouble.
Found by Remi Gacogne. Sourceforge issue
3451433 .
/* Allows deletes to work */
ncalls = ev->ev_ncalls;
- ev->ev_pncalls = &ncalls;
+ if (ncalls != 0)
+ ev->ev_pncalls = &ncalls;
EVBASE_RELEASE_LOCK(base, th_base_lock);
while (ncalls) {
ncalls--;
should_break = base->event_break;
EVBASE_RELEASE_LOCK(base, th_base_lock);
- if (should_break)
+ if (should_break) {
+ if (ncalls != 0)
+ ev->ev_pncalls = NULL;
return;
+ }
}
}