From a75cfe0eb155b6978b12dc78adc34cc2cc9db273 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Tue, 20 Feb 2018 00:20:46 -0500 Subject: [PATCH] POLARIS: Fix several Destroy()s --- code/datums/EPv2.dm | 4 ++++ code/datums/mixed.dm | 3 +-- code/datums/progressbar.dm | 6 ++++-- .../items/devices/communicator/communicator.dm | 13 ++++++++----- code/game/objects/items/weapons/implants/implant.dm | 3 ++- code/modules/mob/mob_planes.dm | 3 +++ code/modules/nano/modules/nano_module.dm | 4 ++++ 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/code/datums/EPv2.dm b/code/datums/EPv2.dm index 37a1a0ba1f1..a41175f424e 100644 --- a/code/datums/EPv2.dm +++ b/code/datums/EPv2.dm @@ -40,6 +40,10 @@ var/global/list/all_exonet_connections = list() src.holder = holder ..() +/datum/exonet_protocol/Destroy() + remove_address() + holder = null + return ..() // Proc: make_address() // Parameters: 1 (string - used to make into a hash that will be part of the new address) diff --git a/code/datums/mixed.dm b/code/datums/mixed.dm index ab53596d8cc..191868e4891 100644 --- a/code/datums/mixed.dm +++ b/code/datums/mixed.dm @@ -34,8 +34,7 @@ data_core.medical -= src data_core.general -= src data_core.security -= src - ..() - return QDEL_HINT_FINDREFERENCE // If we must, we can resort to QDEL_HINT_HARDDEL. But lets see how this works in practice ~Leshana + . = ..() /datum/data/text name = "text" diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index bed0f332752..afcb65a8c15 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -22,8 +22,10 @@ /datum/progressbar/Destroy() if (client) client.images -= bar - qdel(bar) - . = ..() + qdel_null(bar) + user = null + client = null + return ..() /datum/progressbar/proc/update(progress) //world << "Update [progress] - [goal] - [(progress / goal)] - [((progress / goal) * 100)] - [round(((progress / goal) * 100), 5)]" diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index cac80c84d09..f809bcb9b2d 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -287,17 +287,20 @@ var/global/list/obj/item/device/communicator/all_communicators = list() to_chat(voice, "\icon[src] Connection timed out with remote host.") qdel(voice) close_connection(reason = "Connection timed out") + + //Clean up all references we might have to others communicating.Cut() voice_requests.Cut() voice_invites.Cut() + node = null + + //Clean up references that might point at us all_communicators -= src processing_objects -= src listening_objects.Remove(src) - qdel(camera) - camera = null - if(exonet) - exonet.remove_address() - exonet = null + qdel_null(camera) + qdel_null(exonet) + return ..() // Proc: update_icon() diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 1d515e863b4..d28779fc087 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -52,7 +52,9 @@ /obj/item/weapon/implant/Destroy() if(part) part.implants.Remove(src) + listening_objects.Remove(src) part = null + imp_in = null return ..() /obj/item/weapon/implant/attackby(obj/item/I, mob/user) @@ -82,7 +84,6 @@ /obj/item/weapon/implant/tracking/implanted(var/mob/source) processing_objects.Add(src) - listening_objects |= src return 1 /obj/item/weapon/implant/tracking/Destroy() diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm index 048992c380d..1252ed6649f 100644 --- a/code/modules/mob/mob_planes.dm +++ b/code/modules/mob/mob_planes.dm @@ -94,6 +94,9 @@ var/invis_toggle = FALSE var/list/sub_planes +/obj/screen/plane_master/New() + ..(null) //Never be in anything ever. + /obj/screen/plane_master/proc/set_desired_alpha(var/new_alpha) if(new_alpha != alpha && new_alpha > 0 && new_alpha <= 255) desired_alpha = new_alpha diff --git a/code/modules/nano/modules/nano_module.dm b/code/modules/nano/modules/nano_module.dm index 0cdf451d6fb..8ced14f4c5a 100644 --- a/code/modules/nano/modules/nano_module.dm +++ b/code/modules/nano/modules/nano_module.dm @@ -5,6 +5,10 @@ /datum/nano_module/New(var/host) src.host = host +/datum/nano_module/Destroy() + host = null + return ..() + /datum/nano_module/nano_host() return host ? host : src