1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

cancel pipe: make sure we closed it on destroy with no EVENTFD case

This commit is contained in:
Andy Green 2021-09-08 11:25:47 +01:00
parent ec242e9fe7
commit 2a6dc12464

View file

@ -1625,11 +1625,25 @@ lws_pt_destroy(struct lws_context_per_thread *pt)
vpt->foreign_pfd_list = NULL;
lws_pt_lock(pt, __func__);
if (pt->pipe_wsi) {
lws_destroy_event_pipe(pt->pipe_wsi);
pt->pipe_wsi = NULL;
}
if (pt->dummy_pipe_fds[0]
#if !defined(WIN32)
&& (int)pt->dummy_pipe_fds[0] != -1
#endif
) {
struct lws wsi;
memset(&wsi, 0, sizeof(wsi));
wsi.a.context = pt->context;
wsi.tsi = (char)pt->tid;
lws_plat_pipe_close(&wsi);
}
#if defined(LWS_WITH_SECURE_STREAMS)
lws_dll2_foreach_safe(&pt->ss_owner, NULL, lws_ss_destroy_dll);