More and more Destroy() cleanups all across the board - Return qdel hints.

This commit is contained in:
Leshana
2017-06-05 21:55:18 -04:00
parent 010cca1d44
commit e48b548f2b
51 changed files with 128 additions and 113 deletions

View File

@@ -1294,6 +1294,13 @@ var/mob/dview/dview_mob = new
else
living_mob_list -= src
/mob/dview/Destroy(var/force)
crash_with("Attempt to delete the dview_mob: [log_info_line(src)]")
if (!force)
return QDEL_HINT_LETMELIVE
global.dview_mob = new
return ..()
// call to generate a stack trace and print to runtime logs
/proc/crash_with(msg)
CRASH(msg)

View File

@@ -20,7 +20,7 @@
message_admins("ERROR: ability_master's New() was not given an owner argument. This is a bug.")
/obj/screen/movable/ability_master/Destroy()
..()
. = ..()
//Get rid of the ability objects.
remove_all_abilities()
ability_objects.Cut()

View File

@@ -30,6 +30,9 @@
/datum/action/Destroy()
if(owner)
Remove(owner)
target = null
qdel_null(button)
return ..()
/datum/action/proc/Grant(mob/living/T)
if(owner)
@@ -45,7 +48,7 @@
if(button)
if(T.client)
T.client.screen -= button
del(button)
qdel_null(button)
T.actions.Remove(src)
T.update_action_buttons()
owner = null

View File

@@ -155,7 +155,7 @@ datum/hud/New(mob/owner)
..()
/datum/hud/Destroy()
..()
. = ..()
grab_intent = null
hurt_intent = null
disarm_intent = null

View File

@@ -46,7 +46,7 @@
var/obj/item/owner
/obj/screen/item_action/Destroy()
..()
. = ..()
owner = null
/obj/screen/item_action/Click()

View File

@@ -13,7 +13,7 @@
var/mob/spell_holder
/obj/screen/movable/spell_master/Destroy()
..()
. = ..()
for(var/obj/screen/spell/spells in spell_objects)
spells.spellmaster = null
spell_objects.Cut()
@@ -156,7 +156,7 @@
var/icon/last_charged_icon
/obj/screen/spell/Destroy()
..()
. = ..()
spell = null
last_charged_icon = null
if(spellmaster)

View File

@@ -314,7 +314,6 @@ var/global/datum/controller/radio/radio_controller
devices_line -= null
if (devices_line.len==0)
devices -= devices_filter
del(devices_line)
/datum/signal
var/obj/source

View File

@@ -23,9 +23,15 @@ var/global/list/round_voters = list() // Keeps track of the individuals voting f
/datum/controller/vote/New()
if(vote != src)
if(istype(vote))
del(vote)
Recover()
qdel(vote)
vote = src
/datum/controller/vote/Destroy()
..()
// Tell qdel() to Del() this object.
return QDEL_HINT_HARDDEL_NOW
/datum/controller/vote/proc/process() //called by master_controller
if(mode)
// No more change mode votes after the game has started.

View File

@@ -48,6 +48,7 @@ var/list/wireColours = list("red", "blue", "green", "darkred", "orange", "brown"
/datum/wires/Destroy()
holder = null
signallers.Cut()
return ..()
/datum/wires/proc/GenerateWires()

View File

@@ -145,7 +145,7 @@ obj/machinery/door/airlock/New()
obj/machinery/door/airlock/Destroy()
if(frequency && radio_controller)
radio_controller.remove_object(src,frequency)
..()
return ..()
obj/machinery/airlock_sensor
icon = 'icons/obj/airlock_machines.dmi'
@@ -220,7 +220,7 @@ obj/machinery/airlock_sensor/New()
obj/machinery/airlock_sensor/Destroy()
if(radio_controller)
radio_controller.remove_object(src,frequency)
..()
return ..()
obj/machinery/airlock_sensor/airlock_interior
command = "cycle_interior"
@@ -292,7 +292,7 @@ obj/machinery/access_button/New()
obj/machinery/access_button/Destroy()
if(radio_controller)
radio_controller.remove_object(src, frequency)
..()
return ..()
obj/machinery/access_button/airlock_interior
frequency = 1379

View File

@@ -202,7 +202,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
/obj/machinery/hologram/holopad/Destroy()
for (var/mob/living/silicon/ai/master in masters)
clear_holo(master)
..()
return ..()
/*
Holographic project of everything else.

View File

@@ -23,9 +23,8 @@
update_icon()
/obj/machinery/pipelayer/Destroy()
qdel(W)
W = null
..()
qdel_null(W)
. = ..()
/obj/machinery/pipelayer/RefreshParts()
var/mb_rating = 0

View File

@@ -21,11 +21,6 @@
if(can_buckle && istype(M))
user_buckle_mob(M, user)
//Cleanup
/obj/Del()
unbuckle_mob()
return ..()
/obj/Destroy()
unbuckle_mob()
return ..()

View File

@@ -1470,8 +1470,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/Destroy()
PDAs -= src
if (src.id && prob(90)) //IDs are kept in 90% of the cases
src.id.loc = get_turf(src.loc)
..()
src.id.forceMove(get_turf(src.loc))
else
qdel_null(src.id)
qdel_null(src.cartridge)
qdel_null(src.pai)
return ..()
/obj/item/device/pda/clown/Crossed(AM as mob|obj) //Clown PDA is slippery.
if (istype(AM, /mob/living))

View File

@@ -78,6 +78,10 @@ var/list/civilian_cartridges = list(
var/message2
var/list/stored_data = list()
/obj/item/weapon/cartridge/Destroy()
qdel_null(radio)
return ..()
/obj/item/weapon/cartridge/engineering
name = "\improper Power-ON cartridge"
icon_state = "cart-e"
@@ -164,10 +168,6 @@ var/list/civilian_cartridges = list(
radio = new /obj/item/radio/integrated/signal(src)
..()
/obj/item/weapon/cartridge/signal/Destroy()
qdel(radio)
..()
/obj/item/weapon/cartridge/quartermaster
name = "\improper Space Parts & Space Vendors cartridge"
desc = "Perfect for the Quartermaster on the go!"

View File

@@ -803,7 +803,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
if(exonet)
exonet.remove_address()
exonet = null
..()
return ..()
// Proc: update_icon()
// Parameters: None

View File

@@ -96,7 +96,7 @@
/obj/item/device/radio/intercom/Destroy()
processing_objects -= src
..()
return ..()
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
src.add_fingerprint(user)

View File

@@ -42,7 +42,7 @@ Protectiveness | Armor %
/obj/item/clothing/Destroy()
processing_objects -= src
..()
return ..()
/obj/item/clothing/get_material()
return material

View File

@@ -26,7 +26,7 @@
T.dirt = 0
for(var/obj/effect/O in src)
if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay))
del(O)
qdel(O)
/* //Reagent code changed at some point and the below doesn't work. To be fixed later.
source.reagents.reaction(src, TOUCH, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly.
source.reagents.remove_any(1) //reaction() doesn't use up the reagents
@@ -47,16 +47,16 @@
return
..()
/obj/item/weapon/mop_deploy/Del()
/obj/item/weapon/mop_deploy/Destroy()
processing_objects -= src
..()
. = ..()
/obj/item/weapon/mop_deploy/attack_self(mob/user as mob)
user.drop_from_inventory(src)
spawn(1) if(src) del(src)
spawn(1) if(!QDELETED(src)) qdel(src)
/obj/item/weapon/mop_deploy/dropped()
spawn(1) if(src) del(src)
spawn(1) if(!QDELETED(src)) qdel(src)
/obj/item/weapon/mop_deploy/process()
if(!creator || loc != creator || !creator.item_is_in_hands(src))
@@ -71,4 +71,4 @@
host.pinned -= src
host.embedded -= src
host.drop_from_inventory(src)
spawn(1) if(src) del(src)
spawn(1) if(!QDELETED(src)) qdel(src)

View File

@@ -12,7 +12,7 @@
/obj/item/weapon/storage/internal/Destroy()
master_item = null
..()
. = ..()
/obj/item/weapon/storage/internal/attack_hand()
return //make sure this is never picked up

View File

@@ -38,15 +38,15 @@
/obj/item/weapon/storage/Destroy()
close_all()
qdel(boxes)
qdel(src.storage_start)
qdel(src.storage_continue)
qdel(src.storage_end)
qdel(src.stored_start)
qdel(src.stored_continue)
qdel(src.stored_end)
qdel(closer)
..()
qdel_null(boxes)
qdel_null(src.storage_start)
qdel_null(src.storage_continue)
qdel_null(src.storage_end)
qdel_null(src.stored_start)
qdel_null(src.stored_continue)
qdel_null(src.stored_end)
qdel_null(closer)
. = ..()
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if(!canremove)

View File

@@ -44,8 +44,7 @@ var/list/global/tank_gauge_cache = list()
return
/obj/item/weapon/tank/Destroy()
if(air_contents)
qdel(air_contents)
qdel_null(air_contents)
processing_objects.Remove(src)
@@ -53,7 +52,7 @@ var/list/global/tank_gauge_cache = list()
var/obj/item/device/transfer_valve/TTV = loc
TTV.remove_tank(src)
..()
return ..()
/obj/item/weapon/tank/examine(mob/user)
. = ..(user, 0)

View File

@@ -49,9 +49,6 @@
if(climbable)
verbs += /obj/structure/proc/climb_on
/obj/structure/Destroy()
..()
/obj/structure/proc/climb_on()
set name = "Climb structure"

View File

@@ -355,12 +355,9 @@
density = 0
update_nearby_tiles()
var/turf/location = loc
loc = null
. = ..()
for(var/obj/structure/window/W in orange(location, 1))
W.update_icon()
loc = location
..()
/obj/structure/window/Move()
var/ini_dir = dir

View File

@@ -477,7 +477,7 @@
for(var/obj/item/weapon/mop_deploy/blade in M.contents)
M.drop_from_inventory(blade)
del(blade)
qdel(blade)
//Space Cleaner Launcher
@@ -520,7 +520,7 @@
user << "<font color='blue'><b>You slot \the [input_device] into the suit module.</b></font>"
user.drop_from_inventory(input_device)
del(input_device)
qdel(input_device)
accepted_item.charges++
return 1

View File

@@ -131,3 +131,9 @@
/datum/lighting_corner/dummy/New()
return
/datum/lighting_corner/Destroy(var/force)
if (!force)
return QDEL_HINT_LETMELIVE
crash_with("Who decided to force qdel() a lighting corner? Why did you do this?")
return ..()

View File

@@ -39,7 +39,7 @@
log_debug("A lighting overlay realised its loc was NOT a turf (actual loc: [loc][loc ? ", " + loc.type : "null"]) in update_overlay() and got qdel'ed!")
else
log_debug("A lighting overlay realised it was in nullspace in update_overlay() and got pooled!")
qdel(src)
qdel(src, force=TRUE)
return
// To the future coder who sees this and thinks
@@ -121,14 +121,17 @@
/atom/movable/lighting_overlay/throw_at()
return 0
/atom/movable/lighting_overlay/Destroy()
total_lighting_overlays--
global.lighting_update_overlays -= src
global.lighting_update_overlays_old -= src
/atom/movable/lighting_overlay/Destroy(var/force)
if (force)
total_lighting_overlays--
global.lighting_update_overlays -= src
global.lighting_update_overlays_old -= src
var/turf/T = loc
if(istype(T))
T.lighting_overlay = null
T.luminosity = 1
var/turf/T = loc
if(istype(T))
T.lighting_overlay = null
T.luminosity = 1
. = ..()
return ..()
else
return QDEL_HINT_LETMELIVE

View File

@@ -59,7 +59,7 @@
/mob/living/silicon/ai/Destroy()
destroy_eyeobj()
..()
return ..()
/atom/proc/move_camera_by_click()
if(istype(usr, /mob/living/silicon/ai))

View File

@@ -59,7 +59,7 @@
/obj/machinery/camera/Destroy()
clear_all_networks()
cameranet.cameras -= src
..()
return ..()
// Mobs
/mob/living/silicon/ai/rejuvenate()

View File

@@ -38,7 +38,11 @@ mob/observer/eye/Destroy()
qdel(ghostimage)
ghostimage = null
updateallghostimages()
..()
if(owner)
if(owner.eyeobj == src)
owner.eyeobj = null
owner = null
. = ..()
/mob/observer/eye/Move(n, direct)
if(owner == src)

View File

@@ -25,7 +25,7 @@
/mob/living/Destroy()
cultnet.updateVisibility(src, 0)
..()
return ..()
/mob/living/rejuvenate()
var/was_dead = stat == DEAD

View File

@@ -15,7 +15,7 @@
/turf/simulated/Destroy()
updateVisibility(src)
..()
return ..()
/turf/simulated/New()
..()
@@ -26,7 +26,7 @@
/obj/structure/Destroy()
updateVisibility(src)
..()
return ..()
/obj/structure/New()
..()

View File

@@ -14,7 +14,7 @@
/datum/visualnet/Destroy()
visual_nets -= src
..()
return ..()
// Checks if a chunk has been Generated in x, y, z.
/datum/visualnet/proc/chunkGenerated(x, y, z)

View File

@@ -27,7 +27,7 @@ var/list/holder_mob_icon_cache = list()
/obj/item/weapon/holder/Destroy()
processing_objects.Remove(src)
..()
return ..()
/obj/item/weapon/holder/process()
update_state()

View File

@@ -215,20 +215,15 @@ var/list/ai_verbs_hidden = list( // For why this exists, refer to https://xkcd.c
/mob/living/silicon/ai/Destroy()
ai_list -= src
qdel(eyeobj)
eyeobj = null
qdel(psupply)
psupply = null
qdel(aiMulti)
aiMulti = null
qdel(aiRadio)
aiRadio = null
qdel(aiCamera)
aiCamera = null
qdel_null(announcement)
qdel_null(eyeobj)
qdel_null(psupply)
qdel_null(aiPDA)
qdel_null(aiCommunicator)
qdel_null(aiMulti)
qdel_null(aiRadio)
qdel_null(aiCamera)
hack = null
return ..()

View File

@@ -41,7 +41,7 @@
silicon_mob_list -= src
for(var/datum/alarm_handler/AH in alarm_manager.all_handlers)
AH.unregister_alarm(src)
..()
return ..()
/mob/living/silicon/proc/init_id()
if(idcard)

View File

@@ -195,7 +195,7 @@
friends.Cut() //This one is not
walk_list.Cut()
languages.Cut()
..()
return ..()
//Client attached
/mob/living/simple_animal/Login()

View File

@@ -393,9 +393,6 @@
/obj/item/weapon/grab/proc/size_difference(mob/A, mob/B)
return mob_size_difference(A.mob_size, B.mob_size)
/obj/item/weapon/grab
var/destroying = 0
/obj/item/weapon/grab/Destroy()
animate(affecting, pixel_x = 0, pixel_y = 0, 4, 1, LINEAR_EASING)
affecting.layer = 4
@@ -408,5 +405,4 @@
assailant = null
qdel(hud)
hud = null
destroying = 1 // stops us calling qdel(src) on dropped()
..()
return ..()

View File

@@ -73,7 +73,7 @@
/mob/living/Destroy()
remove_all_modifiers(TRUE)
..()
return ..()
// Called by Life().
/mob/living/proc/handle_modifiers()

View File

@@ -20,7 +20,7 @@
var/update_locked = 0
/obj/machinery/power/breakerbox/Destroy()
..()
. = ..()
for(var/datum/nano_module/rcon/R in world)
R.FindDevices()

View File

@@ -108,7 +108,7 @@ var/list/possible_cable_coil_colours = list(
if(powernet)
cut_cable_from_powernet() // update the powernets
cable_list -= src //remove it from global cable list
..() // then go ahead and delete the cable
return ..() // then go ahead and delete the cable
// Ghost examining the cable -> tells him the power
/obj/structure/cable/attack_ghost(mob/user)

View File

@@ -28,7 +28,7 @@
/obj/machinery/power/grid_checker/Destroy()
qdel(wires)
wires = null
..()
return ..()
/obj/machinery/power/grid_checker/update_icon()
if(power_failing)

View File

@@ -248,7 +248,7 @@
if(A)
on = 0
// A.update_lights()
..()
return ..()
/obj/machinery/light/update_icon()

View File

@@ -19,7 +19,7 @@
disconnect_from_network()
disconnect_terminal()
..()
return ..()
///////////////////////////////
// General procedures

View File

@@ -23,7 +23,7 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/Destroy()
rad_collectors -= src
..()
return ..()
/obj/machinery/power/rad_collector/process()
//so that we don't zero out the meter if the SM is processed first.

View File

@@ -205,7 +205,7 @@
if(holder && holder.my_atom && ismob(holder.my_atom))
var/mob/M = holder.my_atom
M.status_flags &= ~FAKEDEATH
..()
return ..()
/datum/reagent/toxin/fertilizer //Reagents used for plant fertilizers.
name = "fertilizer"

View File

@@ -6,12 +6,10 @@
/obj/structure/window/Destroy()
var/oldloc = loc
loc=null
. = ..()
for(var/obj/structure/table/T in view(oldloc, 1))
T.update_connections()
T.update_icon()
loc=oldloc
..()
/obj/structure/window/Move()
var/oldloc = loc

View File

@@ -26,7 +26,8 @@ var/global/datum/global_init/init = new ()
qdel(src) //we're done
/datum/global_init/Destroy()
return 1
global.init = null
return 2 // QDEL_HINT_IWILLGC
/world
mob = /mob/new_player

View File

@@ -54,7 +54,7 @@
B.item_state = "melted"
new /obj/item/weapon/paper/sc_safehint_paper_bible(B)
new /obj/item/weapon/pen(B)
del(src)
qdel(src)
/*
* Guns - I'm making these specifically so that I dont spawn a pile of fully loaded weapons on the map.
@@ -189,7 +189,7 @@ var/sc_safecode5 = "[rand(0,9)]"
else if(istype(A,/obj/))
var/obj/O = A
O.ex_act(1.0)
if(O) del(O)
if(O) qdel(O)
else if(isturf(A))
var/turf/T = A
if(T.intact)

View File

@@ -133,7 +133,7 @@
s.start()
explosion(mob, 1, 0, 0, 0)
spawn(0)
del(src)
qdel(src)
/obj/effect/meatgrinder
name = "Meat Grinder"

View File

@@ -161,5 +161,10 @@ var/list/all_maps = list()
if(transit_chance)
map.accessible_z_levels["[z]"] = transit_chance
/datum/map_z_level/Destroy()
return TRUE // No.
/datum/map_z_level/Destroy(var/force)
crash_with("Attempt to delete a map_z_level instance [log_info_line(src)]")
if(!force)
return QDEL_HINT_LETMELIVE // No.
if (using_map.zlevels["[z]"] == src)
using_map.zlevels -= "[z]"
return ..()