Fixed WebSocket.cpp memory leaks (#17653)

This commit is contained in:
Wilson E. Alvarez 2017-04-09 22:28:05 -04:00 committed by minggo
parent 1c697796ea
commit 21f51f0f48
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}
}