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