Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion code/controllers/subsystem/garbage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/autowiki/autowiki.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/food_and_drinks/coffee/machine/impressa.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/tgui/tgui_alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

/datum/tgui_modal/Destroy(force)
SStgui.close_uis(src)
QDEL_NULL(buttons)
buttons = null
. = ..()

/**
Expand Down
Loading