GC cleanup (#8211)

This commit is contained in:
Cadyn
2024-04-10 22:48:37 -07:00
committed by GitHub
parent 43b856c621
commit 985f3401a9
7 changed files with 29 additions and 2 deletions

View File

@@ -99,3 +99,10 @@ SUBSYSTEM_DEF(mobs)
/datum/controller/subsystem/mobs/critfail()
..()
log_recent()
//CHOMPEdit Begin
//Mobs need to immediately removed from the SS list on Destroy
/mob/Destroy()
. = ..()
SSmobs.currentrun -= src
//CHOMPEdit End

View File

@@ -141,7 +141,8 @@ SUBSYSTEM_DEF(plants)
return
/datum/controller/subsystem/plants/proc/add_plant(var/obj/effect/plant/plant)
processing |= plant
if(!QDELETED(plant)) //CHOMPEdit GC
processing |= plant //CHOMPEdit GC
/datum/controller/subsystem/plants/proc/remove_plant(var/obj/effect/plant/plant)
processing -= plant

View File

@@ -146,3 +146,10 @@ SUBSYSTEM_DEF(radiation)
return
var/turf/epicentre = locate(round(world.maxx / 2), round(world.maxy / 2), source.z)
flat_radiate(epicentre, power, world.maxx, respect_maint)
//CHOMPEdit Begin
//Putting this here so it can be promptly nuked if I ever redo the radiation subsystem
/mob/living/Destroy()
. = ..()
SSradiation.listeners -= src
//CHOMPEdit End

View File

@@ -45,6 +45,7 @@
render_target = ref(src)
em_block = new(src, render_target)
add_overlay(list(em_block), TRUE)
RegisterSignal(em_block, COMSIG_PARENT_QDELETING, PROC_REF(emblocker_gc)) //CHOMPEdit deal with emblocker deleting. see atoms_movable_ch.dm
if(opacity)
AddElement(/datum/element/light_blocking)
if(icon_scale_x != DEFAULT_ICON_SCALE_X || icon_scale_y != DEFAULT_ICON_SCALE_Y || icon_rotation != DEFAULT_ICON_ROTATION)

View File

@@ -63,3 +63,9 @@
/atom/movable/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
return
/atom/movable/proc/emblocker_gc(var/datum/source)
UnregisterSignal(source, COMSIG_PARENT_QDELETING)
cut_overlay(source)
if(em_block == source)
em_block = null

View File

@@ -469,7 +469,7 @@
impacted_mobs.Cut()
impacted_mobs = null
qdel(trajectory)
QDEL_NULL(trajectory) //CHOMPEdit
cleanup_beam_segments()
if(my_case)

View File

@@ -115,6 +115,11 @@
dark_tile.unlinked()
return ..()
/obj/effect/dark/Destroy()
. = ..()
if(linked_node)
linked_node.children_effects -= src
/obj/effect/dark/process()
set background = 1
var/turf/U = get_turf(src)