From 425567a43b0258b59d87173fec663bc00733eaee Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Fri, 24 Apr 2026 17:43:21 -0400 Subject: [PATCH] Materials And Stack Harddel (#22313) To clarify I have recently cancelled my subscription to google's coding agents, so this is my first hard del PR in several weeks that was done completely by hand. This PR fixes a hard del on Materials (and their parent Stacks), which was being caused by up to 4 different vars potentially containing references that were not being cleared during their Destroy() procs. I have also tested this by hand, by spawning and deleting stacks, then waiting to see if the hard del triggers or not. --------- Signed-off-by: VMSolidus --- code/game/objects/items/stacks/stack.dm | 4 ++++ code/modules/materials/material_sheets.dm | 4 ++++ html/changelogs/hellfirejag-materials-hard-del.yml | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 html/changelogs/hellfirejag-materials-hard-del.yml diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index ddb24daf839..1bfa790961d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -62,6 +62,10 @@ if (src && usr && usr.machine == src) usr << browse(null, "window=stack") usr.unset_machine() + + recipes = null + build_type = null + synths = null return ..() /obj/item/stack/update_icon() diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 847730f016f..bcc79ef52d4 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -50,6 +50,10 @@ matter = material.get_matter() +/obj/item/stack/material/Destroy() + material = null + return ..() + /obj/item/stack/material/get_material() return material diff --git a/html/changelogs/hellfirejag-materials-hard-del.yml b/html/changelogs/hellfirejag-materials-hard-del.yml new file mode 100644 index 00000000000..26c940768b3 --- /dev/null +++ b/html/changelogs/hellfirejag-materials-hard-del.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Removed a hard del related to material stacks."