Add weakrefs, because just two types of ref wasn't confusing enough (#3020)

Ports a new type of reference from bay: weakrefs.

They validate type like hard-refs, but don't block GC like soft-refs. Performance-wise are worse than both, but generally more convenient than softrefs.
This commit is contained in:
Lohikar
2017-07-13 21:04:19 +03:00
committed by skull132
parent c3fe2cf871
commit 216039eb2e
4 changed files with 41 additions and 0 deletions
+1
View File
@@ -227,6 +227,7 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
// This should be overridden to remove all references pointing to the object being destroyed.
// Return the appropriate QDEL_HINT; in most cases this is QDEL_HINT_QUEUE.
/datum/proc/Destroy(force=FALSE)
weakref = null
destroyed_event.raise_event(src)
SSnanoui.close_uis(src)
tag = null