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.
This commit is contained in:
Sergi Rosell 2026-10-05 02:53:41 +02:00 • committed by GitHub
parent d26ae63e94
commit ab89cd80f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)