Loading src/event/iocp.cpp +4 −1 Changes for src/event/iocp.cpp: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -98,7 +98,9 @@ namespace netplus { } void RemoveFromClientList(client* pClientContext) { std::lock_guard<std::mutex> lock(g_ClientContextMutex); std::lock(g_ClientContextMutex, pClientContext->cltmtx); std::lock_guard<std::mutex> lock1(g_ClientContextMutex, std::adopt_lock); std::lock_guard<std::mutex> lock2(pClientContext->cltmtx, std::adopt_lock); auto it = std::find(g_ClientContext.begin(), g_ClientContext.end(), pClientContext); if (it != g_ClientContext.end()) { g_ClientContext.erase(it); Loading Loading @@ -269,6 +271,7 @@ namespace netplus { if(e.getErrorType()!=NetException::Note){ closesocket(pClientContext->CurCon->csock->fd()); eargs->evpoll->RemoveFromClientList(pClientContext); pClientContext = nullptr; continue; } } Loading Loading
src/event/iocp.cpp +4 −1 Changes for src/event/iocp.cpp: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -98,7 +98,9 @@ namespace netplus { } void RemoveFromClientList(client* pClientContext) { std::lock_guard<std::mutex> lock(g_ClientContextMutex); std::lock(g_ClientContextMutex, pClientContext->cltmtx); std::lock_guard<std::mutex> lock1(g_ClientContextMutex, std::adopt_lock); std::lock_guard<std::mutex> lock2(pClientContext->cltmtx, std::adopt_lock); auto it = std::find(g_ClientContext.begin(), g_ClientContext.end(), pClientContext); if (it != g_ClientContext.end()) { g_ClientContext.erase(it); Loading Loading @@ -269,6 +271,7 @@ namespace netplus { if(e.getErrorType()!=NetException::Note){ closesocket(pClientContext->CurCon->csock->fd()); eargs->evpoll->RemoveFromClientList(pClientContext); pClientContext = nullptr; continue; } } Loading