diff --git a/Content.Client/Command/CommunicationsConsoleMenu.cs b/Content.Client/Command/CommunicationsConsoleMenu.cs index 8537b74cfc..3addc2c1ad 100644 --- a/Content.Client/Command/CommunicationsConsoleMenu.cs +++ b/Content.Client/Command/CommunicationsConsoleMenu.cs @@ -1,4 +1,4 @@ -using System.Threading; +using System.Threading; using Content.Client.GameObjects.Components.Command; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -68,7 +68,9 @@ namespace Content.Client.Command protected override void Dispose(bool disposing) { - if(disposing) + base.Dispose(disposing); + + if (disposing) _timerCancelTokenSource.Cancel(); } } diff --git a/Content.Client/GameObjects/Components/Arcade/BlockGameBoundUserInterface.cs b/Content.Client/GameObjects/Components/Arcade/BlockGameBoundUserInterface.cs index 306abd0aef..4e27a40d3d 100644 --- a/Content.Client/GameObjects/Components/Arcade/BlockGameBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Arcade/BlockGameBoundUserInterface.cs @@ -74,7 +74,9 @@ namespace Content.Client.GameObjects.Components.Arcade protected override void Dispose(bool disposing) { base.Dispose(disposing); - if(!disposing) { return; } + if (!disposing) + return; + _menu?.Dispose(); } } diff --git a/Content.Client/GameObjects/Components/Arcade/SpaceVillainArcadeBoundUserInterface.cs b/Content.Client/GameObjects/Components/Arcade/SpaceVillainArcadeBoundUserInterface.cs index 0c053a004d..fb317f69e7 100644 --- a/Content.Client/GameObjects/Components/Arcade/SpaceVillainArcadeBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Arcade/SpaceVillainArcadeBoundUserInterface.cs @@ -48,7 +48,9 @@ namespace Content.Client.GameObjects.Components.Arcade protected override void Dispose(bool disposing) { base.Dispose(disposing); - if(!disposing) { return; } + if (!disposing) + return; + _menu?.Dispose(); } } diff --git a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs b/Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs index 810d57182e..6745fc610d 100644 --- a/Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Atmos/GasAnalyzerBoundUserInterface.cs @@ -35,8 +35,10 @@ namespace Content.Client.GameObjects.Components.Atmos protected override void Dispose(bool disposing) { base.Dispose(disposing); + if (!disposing) + return; - _menu.Close(); + _menu?.Dispose(); } } } diff --git a/Content.Client/GameObjects/Components/Body/Scanner/BodyScannerBoundUserInterface.cs b/Content.Client/GameObjects/Components/Body/Scanner/BodyScannerBoundUserInterface.cs index 5b2f5b7abc..9ebfaa881e 100644 --- a/Content.Client/GameObjects/Components/Body/Scanner/BodyScannerBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Body/Scanner/BodyScannerBoundUserInterface.cs @@ -50,7 +50,7 @@ namespace Content.Client.GameObjects.Components.Body.Scanner if (disposing) { - _display.Dispose(); + _display?.Dispose(); _template = null; _parts.Clear(); } diff --git a/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserBoundUserInterface.cs b/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserBoundUserInterface.cs index c9dc935a46..6ab682f76b 100644 --- a/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Chemistry/ReagentDispenser/ReagentDispenserBoundUserInterface.cs @@ -111,7 +111,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser if (disposing) { - _window.Dispose(); + _window?.Dispose(); } } } diff --git a/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs b/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs index e4790a1ae9..992d879bf1 100644 --- a/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Command/CommunicationsConsoleBoundUserInterface.cs @@ -1,4 +1,4 @@ -using System; +using System; using Content.Client.Command; using Content.Shared.GameObjects.Components.Command; using Robust.Client.GameObjects.Components.UserInterface; @@ -69,6 +69,7 @@ namespace Content.Client.GameObjects.Components.Command { base.Dispose(disposing); if (!disposing) return; + _menu?.Dispose(); } } diff --git a/Content.Client/GameObjects/Components/HUD/Inventory/StrippableBoundUserInterface.cs b/Content.Client/GameObjects/Components/HUD/Inventory/StrippableBoundUserInterface.cs index 2d102f8d15..cb2ed47c21 100644 --- a/Content.Client/GameObjects/Components/HUD/Inventory/StrippableBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/HUD/Inventory/StrippableBoundUserInterface.cs @@ -40,10 +40,10 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (!disposing) return; - _strippingMenu.Dispose(); + if (!disposing) + return; - _strippingMenu.Close(); + _strippingMenu.Dispose(); } private void UpdateMenu() diff --git a/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerBoundUserInterface.cs b/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerBoundUserInterface.cs index 2280406c5b..ec666d4b17 100644 --- a/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/MedicalScanner/MedicalScannerBoundUserInterface.cs @@ -1,4 +1,4 @@ -using JetBrains.Annotations; +using JetBrains.Annotations; using Robust.Client.GameObjects.Components.UserInterface; using Robust.Shared.GameObjects.Components.UserInterface; using static Content.Shared.GameObjects.Components.Medical.SharedMedicalScannerComponent; @@ -31,5 +31,13 @@ namespace Content.Client.GameObjects.Components.MedicalScanner base.UpdateState(state); _window.Populate((MedicalScannerBoundUserInterfaceState) state); } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) + return; + _window.Dispose(); + } } } diff --git a/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs b/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs index 74842c704e..b5ad84b435 100644 --- a/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/PDA/PDABoundUserInterface.cs @@ -1,4 +1,4 @@ -using System; +using System; using Content.Client.GameObjects.EntitySystems; using Content.Client.Utility; using Content.Shared.GameObjects.Components.PDA; @@ -133,6 +133,9 @@ namespace Content.Client.GameObjects.Components.PDA protected override void Dispose(bool disposing) { base.Dispose(disposing); + if (!disposing) + return; + _menu?.Dispose(); } diff --git a/Content.Client/GameObjects/Components/VendingMachines/VendingMachineBoundUserInterface.cs b/Content.Client/GameObjects/Components/VendingMachines/VendingMachineBoundUserInterface.cs index 5666c01155..805c3c932d 100644 --- a/Content.Client/GameObjects/Components/VendingMachines/VendingMachineBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/VendingMachines/VendingMachineBoundUserInterface.cs @@ -54,7 +54,9 @@ namespace Content.Client.GameObjects.Components.VendingMachines protected override void Dispose(bool disposing) { base.Dispose(disposing); - if(!disposing) { return; } + if (!disposing) + return; + _menu?.Dispose(); } } diff --git a/Content.Client/GameObjects/Components/Wires/WiresBoundUserInterface.cs b/Content.Client/GameObjects/Components/Wires/WiresBoundUserInterface.cs index 03c345c6b1..b46020a8bb 100644 --- a/Content.Client/GameObjects/Components/Wires/WiresBoundUserInterface.cs +++ b/Content.Client/GameObjects/Components/Wires/WiresBoundUserInterface.cs @@ -1,4 +1,4 @@ -using Robust.Client.GameObjects.Components.UserInterface; +using Robust.Client.GameObjects.Components.UserInterface; using Robust.Shared.GameObjects.Components.UserInterface; using static Content.Shared.GameObjects.Components.SharedWiresComponent; @@ -35,8 +35,10 @@ namespace Content.Client.GameObjects.Components.Wires protected override void Dispose(bool disposing) { base.Dispose(disposing); + if (!disposing) + return; - _menu.Close(); + _menu.Dispose(); } } }