From ab89cd80f5dd3ca1220bffad5c599184d6267a23 Mon Sep 17 00:00:00 2001 From: Sergi Rosell <50594106+srosellj@users.noreply.github.com> Date: Mon, 5 Oct 2026 02:53:41 +0200 Subject: [PATCH] fix: release a connection's gumps on disconnect (#2689) `GumpSystem` clears a connection's gumps on `EventSink.Disconnected`, but `Mobile.NetState` raises it after the state is already null, so nothing is ever removed: every connection that touched a gump stays in `_gumps` until restart, with any gumps still open when it closed. It now listens to `BeforeDisconnected`, while `m.NetState` still returns the connection. That event also fires on login, where there is no previous state and the handler does nothing. --- Projects/UOContent/Gumps/Base/GumpSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/UOContent/Gumps/Base/GumpSystem.cs b/Projects/UOContent/Gumps/Base/GumpSystem.cs index ddbb91382..f5252b1ad 100644 --- a/Projects/UOContent/Gumps/Base/GumpSystem.cs +++ b/Projects/UOContent/Gumps/Base/GumpSystem.cs @@ -31,7 +31,7 @@ public static partial class GumpSystem { IncomingPackets.Register(0xB1, 0, true, &DisplayGumpResponse); - EventSink.Disconnected += EventSink_Disconnected; + EventSink.BeforeDisconnected += EventSink_Disconnected; } private static void EventSink_Disconnected(Mobile m)