From 43bb34056697b6b936408be8c4f9a06e3f4b80d2 Mon Sep 17 00:00:00 2001 From: emptyVoid Date: Sun, 27 May 2018 11:57:46 +0700 Subject: [PATCH] Fixed a couple of runtime issues introduced in commit 44efcd6. --- lib/core/private.h | 2 +- lib/plat/lws-plat-win.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/private.h b/lib/core/private.h index a22d35fb4..778520f7c 100644 --- a/lib/core/private.h +++ b/lib/core/private.h @@ -560,7 +560,7 @@ struct lws_context_per_thread { struct lws_pollfd *fds; volatile struct lws_foreign_thread_pollfd * volatile foreign_pfd_list; #ifdef _WIN32 - WSAEVENT *events; + WSAEVENT events; #endif lws_sockfd_type dummy_pipe_fds[2]; struct lws *pipe_wsi; diff --git a/lib/plat/lws-plat-win.c b/lib/plat/lws-plat-win.c index 97afefa66..cd821714e 100644 --- a/lib/plat/lws-plat-win.c +++ b/lib/plat/lws-plat-win.c @@ -272,7 +272,7 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) lws_pt_unlock(pt); } - ev = WSAWaitForMultipleEvents(1, pt->events, FALSE, timeout_ms, FALSE); + ev = WSAWaitForMultipleEvents(1, &pt->events, FALSE, timeout_ms, FALSE); if (ev == WSA_WAIT_EVENT_0) { unsigned int eIdx, err; @@ -477,6 +477,9 @@ LWS_VISIBLE void lws_plat_delete_socket_from_fds(struct lws_context *context, struct lws *wsi, int m) { + struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi]; + + pt->fds_count--; } LWS_VISIBLE void