From f000b7062a731e418ba4249bea64dbcf5aea5a47 Mon Sep 17 00:00:00 2001 From: qicosmos Date: Fri, 15 Dec 2023 21:27:07 +0800 Subject: [PATCH] clean --- src/coro_http/examples/chat_room.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coro_http/examples/chat_room.cpp b/src/coro_http/examples/chat_room.cpp index 70a4a821d..c0bb25281 100644 --- a/src/coro_http/examples/chat_room.cpp +++ b/src/coro_http/examples/chat_room.cpp @@ -65,6 +65,10 @@ int main() { while (true) { result = co_await req.get_conn()->read_websocket(); if (result.ec) { + { + std::scoped_lock lock(mtx); + conn_map.erase((intptr_t)req.get_conn()); + } break; }