diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 1bb1d185c8..1d70aff538 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -352,12 +352,33 @@ SUBSYSTEM_DEF(garbage) /datum/qdel_item/New(mytype) name = "[mytype]" +/proc/non_datum_qdel(to_delete) + var/found_type = "unable to determine type" + var/delable = FALSE + + if(islist(to_delete)) + found_type = "list" + delable = TRUE + + else if(isnum(to_delete)) + found_type = "number" + + else if(ispath(to_delete)) + found_type = "typepath" + + if(delable) + del(to_delete) + + CRASH("Bad qdel ([found_type])") + /// Should be treated as a replacement for the 'del' keyword. /// /// Datums passed to this will be given a chance to clean up references to allow the GC to collect them. /proc/qdel(datum/to_delete, force = FALSE) if(!istype(to_delete)) - del(to_delete) + if(isnull(to_delete)) + return + non_datum_qdel(to_delete) return var/datum/qdel_item/trash = SSgarbage.items[to_delete.type] diff --git a/code/game/world.dm b/code/game/world.dm index 5ad3fa3f4b..17cf90d01d 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -232,7 +232,7 @@ GLOBAL_VAR(restart_counter) else log_world("Test run failed!\n[fail_reasons.Join("\n")]") sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes - qdel(src) //shut it down + del(src) //shut it down /world/Reboot(reason = 0, fast_track = FALSE) if (reason || fast_track) //special reboot, do none of the normal stuff diff --git a/code/modules/autowiki/autowiki.dm b/code/modules/autowiki/autowiki.dm index 33c5bcf2a8..d879a66b60 100644 --- a/code/modules/autowiki/autowiki.dm +++ b/code/modules/autowiki/autowiki.dm @@ -11,7 +11,7 @@ /proc/generate_autowiki() var/output = generate_autowiki_output() rustg_file_write(output, "data/autowiki_edits.txt") - qdel(world) + del(world) #endif /// Returns a string of the autowiki output file diff --git a/code/modules/food_and_drinks/coffee/machine/impressa.dm b/code/modules/food_and_drinks/coffee/machine/impressa.dm index 2c61c4e9a3..e0597ba1d4 100644 --- a/code/modules/food_and_drinks/coffee/machine/impressa.dm +++ b/code/modules/food_and_drinks/coffee/machine/impressa.dm @@ -31,7 +31,7 @@ /obj/machinery/coffeemaker/premium/Destroy() QDEL_NULL(coffeepot) - QDEL_NULL(coffee) + QDEL_LIST(coffee) return ..() /obj/machinery/coffeemaker/premium/Exited(atom/movable/gone, direction) diff --git a/code/modules/tgui/tgui_alert.dm b/code/modules/tgui/tgui_alert.dm index f732bda9ab..b5f7c9d3b6 100644 --- a/code/modules/tgui/tgui_alert.dm +++ b/code/modules/tgui/tgui_alert.dm @@ -82,7 +82,7 @@ /datum/tgui_modal/Destroy(force) SStgui.close_uis(src) - QDEL_NULL(buttons) + buttons = null . = ..() /**