fixes null parent in destroy for components (#32351)

* fixes parent being null in destroy

* extends qdel
This commit is contained in:
Emmett Gaines
2017-11-07 15:35:09 -05:00
committed by CitadelStationBot
parent 36234e94d4
commit 8fb5936c30
4 changed files with 15 additions and 17 deletions
+3 -5
View File
@@ -12,7 +12,7 @@
// Default implementation of clean-up code.
// 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)
/datum/proc/Destroy(force=FALSE, ...)
tag = null
var/list/timers = active_timers
active_timers = null
@@ -27,11 +27,9 @@
if(length(all_components))
for(var/I in all_components)
var/datum/component/C = I
C._RemoveFromParent()
qdel(C)
qdel(C, FALSE, TRUE)
else
var/datum/component/C = all_components
C._RemoveFromParent()
qdel(C)
qdel(C, FALSE, TRUE)
dc.Cut()
return QDEL_HINT_QUEUE