From 5031422faefd0dd88d13ecbb0097aa9f0b9c1d66 Mon Sep 17 00:00:00 2001 From: JackMacWindows Date: Wed, 11 Sep 2024 17:27:28 -0400 Subject: [PATCH] Fixed #376 --- src/apis/http.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/http.cpp b/src/apis/http.cpp index 2794a31f..5148145c 100644 --- a/src/apis/http.cpp +++ b/src/apis/http.cpp @@ -1378,8 +1378,8 @@ static int websocket_server_close(lua_State *L) { lastCFunction = __func__; Computer * comp = get_comp(L); websocket_server::Factory * f = *(websocket_server::Factory**)lua_touserdata(L, lua_upvalueindex(1)); - comp->openWebsocketServers.erase(f->srv->port()); if (f == NULL) return 0; + comp->openWebsocketServers.erase(f->srv->port()); f->srv->stop(); delete f->srv; *(websocket_server::Factory**)lua_touserdata(L, lua_upvalueindex(1)) = NULL; @@ -1390,8 +1390,8 @@ static int websocket_server_free(lua_State *L) { lastCFunction = __func__; Computer * comp = get_comp(L); websocket_server::Factory * f = *(websocket_server::Factory**)lua_touserdata(L, 1); - comp->openWebsocketServers.erase(f->srv->port()); if (f == NULL) return 0; + comp->openWebsocketServers.erase(f->srv->port()); f->srv->stop(); delete f->srv; *(websocket_server::Factory**)lua_touserdata(L, 1) = NULL;