Ports tg's garbage collector subsystem and Destroy() returning qdel hints.
This commit is contained in:
PsiOmegaDelta
2017-06-05 22:10:06 -04:00
committed by Leshana
parent 35230b4e7c
commit ebe5cc916d
49 changed files with 479 additions and 366 deletions
@@ -155,4 +155,5 @@ Data storage vars:
tag = null
arg_list.Cut()
stop()
return QDEL_HINT_LETMELIVE
//Do not call ..()
+1 -1
View File
@@ -36,4 +36,4 @@
/decls/Destroy()
crash_with("Prevented attempt to delete a decl instance: [log_info_line(src)]")
return 1 // Prevents Decl destruction
return QDEL_HINT_LETMELIVE // Prevents Decl destruction
+4 -2
View File
@@ -7,7 +7,9 @@
//obtain a weak reference to a datum
/proc/weakref(datum/D)
if(D.gcDestroyed)
if(!istype(D))
return
if(QDELETED(D))
return
if(!D.weakref)
D.weakref = new/weakref(D)
@@ -22,7 +24,7 @@
/weakref/Destroy()
// A weakref datum should not be manually destroyed as it is a shared resource,
// rather it should be automatically collected by the BYOND GC when all references are gone.
return 0
return QDEL_HINT_LETMELIVE
/weakref/proc/resolve()
var/datum/D = locate(ref)