fix issue where event_del is called before event_set. bad bad thing to do.

pointed out by Mark Kidwell <MKidwell@looksmart.net>


svn:r128
This commit is contained in:
Niels Provos 2004-12-14 03:36:12 +00:00
parent d9cf6fe2f1
commit bd6999b4a2

14
event.c
View File

@ -591,13 +591,21 @@ event_add(struct event *ev, struct timeval *tv)
int
event_del(struct event *ev)
{
struct event_base *base = ev->ev_base;
const struct eventop *evsel = base->evsel;
void *evbase = base->evbase;
struct event_base *base;
const struct eventop *evsel;
void *evbase;
LOG_DBG((LOG_MISC, 80, "event_del: %p, callback %p",
ev, ev->ev_callback));
/* An event without a base has not been added */
if (ev->ev_base == NULL)
return;
base = ev->ev_base;
evsel = base->evsel;
evbase = base->evbase;
assert(!(ev->ev_flags & ~EVLIST_ALL));
/* See if we are just active executing this event in a loop */