mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 18:11:47 +00:00
Add logging to failed GC's that result in a del() call
You can view these logs in-game using a debug verb. You have to use the debug-verbs command to see it. Removed the dellogging compile option. If this is a problem, speak up, but for most users, this new functionality is more useful.
This commit is contained in:
@@ -11,6 +11,9 @@ var/datum/controller/garbage_collector/garbage = new()
|
||||
// refID's are associated with the time at which they time out and need to be manually del()
|
||||
// we do this so we aren't constantly locating them and preventing them from being gc'd
|
||||
|
||||
var/list/logging = list() // list of all types that have failed to GC associated with the number of times that's happened.
|
||||
// the types are stored as strings
|
||||
|
||||
/datum/controller/garbage_collector/proc/AddTrash(var/datum/A)
|
||||
if(!istype(A) || !isnull(A.gc_destroyed))
|
||||
return
|
||||
@@ -37,6 +40,7 @@ var/datum/controller/garbage_collector/garbage = new()
|
||||
if(A && A.gc_destroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake
|
||||
// Something's still referring to the qdel'd object. Kill it.
|
||||
testing("GC: -- \ref[A] | [A.type] was unable to be GC'd and was deleted --")
|
||||
logging["[A.type]"]++
|
||||
del(A)
|
||||
dels++
|
||||
// else
|
||||
|
||||
Reference in New Issue
Block a user