From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:36:57 +0000 (+1000) Subject: Fix network configurator memory leaking (#27346) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=13c65378425e2d8254e8ed4e68061643b1245308;p=space-station-14.git Fix network configurator memory leaking (#27346) * Fix network configurator memory leaking Doesn't dispose this window. * Fix the other part --- diff --git a/Content.Client/NetworkConfigurator/NetworkConfiguratorBoundUserInterface.cs b/Content.Client/NetworkConfigurator/NetworkConfiguratorBoundUserInterface.cs index 264c297b63..80c98f143b 100644 --- a/Content.Client/NetworkConfigurator/NetworkConfiguratorBoundUserInterface.cs +++ b/Content.Client/NetworkConfigurator/NetworkConfiguratorBoundUserInterface.cs @@ -88,6 +88,7 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface base.Dispose(disposing); if (!disposing) return; + _linkMenu?.Dispose(); _listMenu?.Dispose(); _configurationMenu?.Dispose(); } diff --git a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs index b68f8a594b..3460124158 100644 --- a/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs +++ b/Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs @@ -62,7 +62,6 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem SubscribeLocalEvent(OnClearLinks); SubscribeLocalEvent(OnToggleLinks); SubscribeLocalEvent(OnConfigButtonPressed); - SubscribeLocalEvent(OnUiOpenAttempt); SubscribeLocalEvent(OnComponentRemoved); } diff --git a/Content.Shared/DeviceNetwork/Systems/SharedNetworkConfiguratorSystem.cs b/Content.Shared/DeviceNetwork/Systems/SharedNetworkConfiguratorSystem.cs index 4aa9db199d..53928f83a9 100644 --- a/Content.Shared/DeviceNetwork/Systems/SharedNetworkConfiguratorSystem.cs +++ b/Content.Shared/DeviceNetwork/Systems/SharedNetworkConfiguratorSystem.cs @@ -1,10 +1,23 @@ using Content.Shared.Actions; +using Content.Shared.DeviceNetwork.Components; +using Content.Shared.UserInterface; using Robust.Shared.Serialization; namespace Content.Shared.DeviceNetwork.Systems; public abstract class SharedNetworkConfiguratorSystem : EntitySystem { + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnUiOpenAttempt); + } + + private void OnUiOpenAttempt(EntityUid uid, NetworkConfiguratorComponent configurator, ActivatableUIOpenAttemptEvent args) + { + if (configurator.LinkModeActive) + args.Cancel(); + } } public sealed partial class ClearAllOverlaysEvent : InstantActionEvent