From fddca26be0d881f3d53c04ab3aa2fe54eef664e0 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 31 Jan 2020 22:49:28 +0000 Subject: [PATCH] windows: handle pipe destroy when no fd associated with pipe wsi https://github.com/warmcat/libwebsockets/issues/1839 --- lib/core-net/vhost.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core-net/vhost.c b/lib/core-net/vhost.c index 4e90b6b7e..77a07b313 100644 --- a/lib/core-net/vhost.c +++ b/lib/core-net/vhost.c @@ -934,7 +934,9 @@ void lws_destroy_event_pipe(struct lws *wsi) { lwsl_info("%s\n", __func__); - __remove_wsi_socket_from_fds(wsi); + + if (lws_socket_is_valid(wsi->desc.sockfd)) + __remove_wsi_socket_from_fds(wsi); if (!wsi->context->event_loop_ops->destroy_wsi && wsi->context->event_loop_ops->wsi_logical_close) {