Skip to content

Commit

Permalink
Fixed #376
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 authored Sep 11, 2024
1 parent 4512211 commit 5031422
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apis/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 5031422

Please sign in to comment.