Fixed my invalid implementation

This commit is contained in:
WolverinDEV 2019-12-19 18:18:48 +01:00
parent d8d3036ec7
commit 7ee8ba3794
No known key found for this signature in database
GPG key ID: EDEAA93BC72CF30E

View file

@ -217,19 +217,16 @@ ub_ctx_create_event(struct event_base* eb)
ctx->created_bg = 0;
ctx->dothread = 1; /* the processing is in the same process,
makes ub_cancel and ub_ctx_delete do the right thing */
if(eb) {
ctx->event_base = ub_libevent_event_base(eb);
ctx->event_base_malloced = 1;
} else {
ctx->event_base = ub_libevent_event_base(NULL);
ctx->event_base_malloced = 0;
}
bool eb_malloced = !eb;
ctx->event_base = ub_libevent_event_base(eb);
if (!ctx->event_base) {
ub_ctx_delete(ctx);
return NULL;
}
ctx->event_base_malloced = eb_malloced;
return ctx;
}