From f7aeadeb0e75bce4916368462f2066de22d1a1f7 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 25 Sep 2024 09:35:39 +0100 Subject: [PATCH] win: trigger context destroy if pt destroying itself https://github.com/warmcat/libwebsockets/issues/3182 This follows the flow for *nix --- lib/plat/windows/windows-service.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/plat/windows/windows-service.c b/lib/plat/windows/windows-service.c index e9399c957..5f7c7ddb7 100644 --- a/lib/plat/windows/windows-service.c +++ b/lib/plat/windows/windows-service.c @@ -177,6 +177,11 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) // lwsl_notice("%s: idx %d, revents 0x%x\n", __func__, n, pt->fds[n].revents); lws_service_fd_tsi(context, &pt->fds[n], tsi); } + + if (pt->destroy_self) { + lws_context_destroy(pt->context); + return -1; + } return 0; }