mirror of https://github.com/axmolengine/axmol.git
Fixed WebSocket.cpp memory leaks (#17653)
This commit is contained in:
parent
1c697796ea
commit
21f51f0f48
|
@ -362,6 +362,7 @@ void WsThreadHelper::onSubThreadLoop()
|
|||
if (msg->what == WS_MSG_TO_SUBTHREAD_CREATE_CONNECTION)
|
||||
{
|
||||
ws->onClientOpenConnectionRequest();
|
||||
delete *iter;
|
||||
iter = __wsHelper->_subThreadWsMessageQueue->erase(iter);
|
||||
}
|
||||
else
|
||||
|
@ -509,6 +510,7 @@ void WebSocket::closeAllConnections()
|
|||
|
||||
std::lock_guard<std::mutex> lk(__instanceMutex);
|
||||
__websocketInstances->clear();
|
||||
delete __websocketInstances;
|
||||
__websocketInstances = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue