Fix network configurator memory leaking (#27346)
* Fix network configurator memory leaking Doesn't dispose this window. * Fix the other part
This commit is contained in:
@@ -88,6 +88,7 @@ public sealed class NetworkConfiguratorBoundUserInterface : BoundUserInterface
|
|||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
if (!disposing) return;
|
if (!disposing) return;
|
||||||
|
|
||||||
|
_linkMenu?.Dispose();
|
||||||
_listMenu?.Dispose();
|
_listMenu?.Dispose();
|
||||||
_configurationMenu?.Dispose();
|
_configurationMenu?.Dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
|
|||||||
SubscribeLocalEvent<NetworkConfiguratorComponent, NetworkConfiguratorClearLinksMessage>(OnClearLinks);
|
SubscribeLocalEvent<NetworkConfiguratorComponent, NetworkConfiguratorClearLinksMessage>(OnClearLinks);
|
||||||
SubscribeLocalEvent<NetworkConfiguratorComponent, NetworkConfiguratorToggleLinkMessage>(OnToggleLinks);
|
SubscribeLocalEvent<NetworkConfiguratorComponent, NetworkConfiguratorToggleLinkMessage>(OnToggleLinks);
|
||||||
SubscribeLocalEvent<NetworkConfiguratorComponent, NetworkConfiguratorButtonPressedMessage>(OnConfigButtonPressed);
|
SubscribeLocalEvent<NetworkConfiguratorComponent, NetworkConfiguratorButtonPressedMessage>(OnConfigButtonPressed);
|
||||||
SubscribeLocalEvent<NetworkConfiguratorComponent, ActivatableUIOpenAttemptEvent>(OnUiOpenAttempt);
|
|
||||||
|
|
||||||
SubscribeLocalEvent<DeviceListComponent, ComponentRemove>(OnComponentRemoved);
|
SubscribeLocalEvent<DeviceListComponent, ComponentRemove>(OnComponentRemoved);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,23 @@
|
|||||||
using Content.Shared.Actions;
|
using Content.Shared.Actions;
|
||||||
|
using Content.Shared.DeviceNetwork.Components;
|
||||||
|
using Content.Shared.UserInterface;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.DeviceNetwork.Systems;
|
namespace Content.Shared.DeviceNetwork.Systems;
|
||||||
|
|
||||||
public abstract class SharedNetworkConfiguratorSystem : EntitySystem
|
public abstract class SharedNetworkConfiguratorSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
SubscribeLocalEvent<NetworkConfiguratorComponent, ActivatableUIOpenAttemptEvent>(OnUiOpenAttempt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUiOpenAttempt(EntityUid uid, NetworkConfiguratorComponent configurator, ActivatableUIOpenAttemptEvent args)
|
||||||
|
{
|
||||||
|
if (configurator.LinkModeActive)
|
||||||
|
args.Cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed partial class ClearAllOverlaysEvent : InstantActionEvent
|
public sealed partial class ClearAllOverlaysEvent : InstantActionEvent
|
||||||
|
|||||||
Reference in New Issue
Block a user