Commit 8faa650d authored by jan.koester's avatar jan.koester
Browse files

test

parent 314bbd99
Loading
Loading
Loading
Loading
+4 −2
Changes for src/event/iocp.cpp: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -104,11 +104,13 @@ namespace netplus {
		}

		void RemoveFromClientList(client* pClientContext) {
			std::lock_guard<std::mutex> lock(g_ClientContextMutex);
			std::unique_lock<std::mutex> lock1(g_ClientContextMutex, std::defer_lock);
			std::unique_lock<std::mutex> lock2(pClientContext->cltmtx, std::defer_lock);
			std::lock(lock1, lock2);

			auto it = std::find(g_ClientContext.begin(), g_ClientContext.end(), pClientContext);
			if (it != g_ClientContext.end()) {
				g_ClientContext.erase(it);
				delete pClientContext;
			}
		}