Closed lnzhu closed 3 weeks ago
Thanks, this looks good! But I don't think the #if defined
is required. I see why you have it there, but always setting tube->ev_listen = NULL
seems fine regardless if USE_MINI_EVENT
is defined or not. Unless I miss something.
Thanks for reviewing! Yes, #if defined(USE_MINI_EVENT)
is not strictly needed in current code. But tube->ev_listen
is deleted in ub_winsock_unregister_wsaevent
only if USE_MINI_EVENT
is defined. I think it might be safer and future-proof to have the check before calling ub_winsock_unregister_wsaevent
.
It is indeed only freed when USE_MINI_EVENT
is defined.
For the other cases (when not defined, or when ub_event_pluggable.c
is used) setting tube->ev_listen = NULL
always after the ub_winsock_unregister_wsaevent()
call conveys the correct intent that this listener event is no more.
I also prefer that all the USE_MINI_EVENT
#ifdef
s are handled in ub_event(_pluggable).c
and not exposed in tube.c
.
removed #if defined
in the last commit
ub_ctx_delete in libunbound causes heap corruption exception in Windows OS. This issue is only for Windows and discovered when using the lastest libunbound Windows library published here.
ctx->qq_pipe
and the memory of tube->ev_listen is released in ub_winsock_unregister_wsaevent but tube->ev_listen is never set to NULL.tx->qq_pipe
in ub_ctx_delete.ub_event**
instead, which will bring additional changes in different places.