]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove bogus C# finalizers (#28315)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Mon, 27 May 2024 21:52:23 +0000 (23:52 +0200)
committerGitHub <noreply@github.com>
Mon, 27 May 2024 21:52:23 +0000 (17:52 -0400)
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
Content.Client/UserInterface/Systems/Actions/Controls/ActionButtonContainer.cs
Content.Client/UserInterface/Systems/Inventory/Controls/ItemSlotButtonContainer.cs

index abe35bf6d9a8d6ca7aee56eacdfc7d0a0e8ddb78..e453dfd74bff366a6553cab17add4189e7e11f31 100644 (file)
@@ -73,11 +73,6 @@ public sealed class DragDropHelper<T>
         _cfg.OnValueChanged(CCVars.DragDropDeadZone, SetDeadZone, true);
     }
 
-    ~DragDropHelper()
-    {
-        _cfg.UnsubValueChanged(CCVars.DragDropDeadZone, SetDeadZone);
-    }
-
     /// <summary>
     /// Tell the helper that the mouse button was pressed down on
     /// a target, thus a drag has the possibility to begin for this target.
index c5f8adbdea3bc5f1fde3dda52b8d07370bffef4c..38c08dc47216f3a92d192c23386dc9e332cffc9f 100644 (file)
@@ -119,9 +119,4 @@ public class ActionButtonContainer : GridContainer
                 yield return button;
         }
     }
-
-    ~ActionButtonContainer()
-    {
-        UserInterfaceManager.GetUIController<ActionUIController>().RemoveActionContainer();
-    }
 }
index 78c3b40adac8e94d80575b869bd9e50746290e90..7a027fc4f8106c8791267d30cfb43f6c643393f9 100644 (file)
@@ -22,9 +22,4 @@ public sealed class ItemSlotButtonContainer : ItemSlotUIContainer<SlotControl>
     {
         _inventoryController = UserInterfaceManager.GetUIController<InventoryUIController>();
     }
-
-    ~ItemSlotButtonContainer()
-    {
-        _inventoryController.RemoveSlotGroup(SlotGroup);
-    }
 }