From 5a679bb971d687befc4c6b245c570512900bc910 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Mon, 15 May 2023 13:01:41 -0700 Subject: [PATCH] fix: remove connection ID on release --- lib/server.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/server.ml b/lib/server.ml index f3096d25..c47e775d 100644 --- a/lib/server.ml +++ b/lib/server.ml @@ -245,8 +245,9 @@ module Command = struct cid in Hashtbl.replace client_sockets connection_id socket; - connection_handler ~sw socket addr; - Hashtbl.remove client_sockets connection_id))) + Switch.on_release sw (fun () -> + Hashtbl.remove client_sockets connection_id); + connection_handler ~sw socket addr))) done); fun () -> Promise.resolve released_u ()