From cf8fcb170a185c06c966c1a1dcf7eec7ada52745 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 27 May 2024 23:52:23 +0200 Subject: [PATCH] Remove bogus C# finalizers (#28315) Begging people to learn how this programming language works before throwing random syntax into a file. None of these finalizers ever worked. I also checked whether they were memory leaks and needed *proper* shutdown logic, but they're all instantiated-once UI controls that last for the entire lifetime of the program so it's probably fine. --- Content.Client/Interaction/DragDropHelper.cs | 5 ----- .../Systems/Actions/Controls/ActionButtonContainer.cs | 5 ----- .../Systems/Inventory/Controls/ItemSlotButtonContainer.cs | 5 ----- 3 files changed, 15 deletions(-) diff --git a/Content.Client/Interaction/DragDropHelper.cs b/Content.Client/Interaction/DragDropHelper.cs index abe35bf6d9..e453dfd74b 100644 --- a/Content.Client/Interaction/DragDropHelper.cs +++ b/Content.Client/Interaction/DragDropHelper.cs @@ -73,11 +73,6 @@ public sealed class DragDropHelper _cfg.OnValueChanged(CCVars.DragDropDeadZone, SetDeadZone, true); } - ~DragDropHelper() - { - _cfg.UnsubValueChanged(CCVars.DragDropDeadZone, SetDeadZone); - } - /// /// Tell the helper that the mouse button was pressed down on /// a target, thus a drag has the possibility to begin for this target. diff --git a/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs b/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs index c5f8adbdea..38c08dc472 100644 --- a/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs +++ b/Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs @@ -119,9 +119,4 @@ public class ActionButtonContainer : GridContainer yield return button; } } - - ~ActionButtonContainer() - { - UserInterfaceManager.GetUIController().RemoveActionContainer(); - } } diff --git a/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotButtonContainer.cs b/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotButtonContainer.cs index 78c3b40ada..7a027fc4f8 100644 --- a/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotButtonContainer.cs +++ b/Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotButtonContainer.cs @@ -22,9 +22,4 @@ public sealed class ItemSlotButtonContainer : ItemSlotUIContainer { _inventoryController = UserInterfaceManager.GetUIController(); } - - ~ItemSlotButtonContainer() - { - _inventoryController.RemoveSlotGroup(SlotGroup); - } }