mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE case
Based on a patch from Harlan Stenn.
This commit is contained in:
parent
8896a92b07
commit
980597215d
5
event.c
5
event.c
@ -1583,9 +1583,10 @@ event_process_active_single_queue(struct event_base *base,
|
||||
break;
|
||||
case EV_CLOSURE_EVENT_FINALIZE:
|
||||
case EV_CLOSURE_EVENT_FINALIZE_FREE: {
|
||||
void (*evcb_evfinalize)(struct event *, void *) = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize;
|
||||
base->current_event = NULL;
|
||||
void (*evcb_evfinalize)(struct event *, void *);
|
||||
EVUTIL_ASSERT(ev != NULL);
|
||||
base->current_event = NULL;
|
||||
evcb_evfinalize = ev->ev_evcallback.evcb_cb_union.evcb_evfinalize;
|
||||
EVUTIL_ASSERT((evcb->evcb_flags & EVLIST_FINALIZING));
|
||||
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
||||
evcb_evfinalize(ev, ev->ev_arg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user