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
+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)