RETURNTOPOOL AND VARIOUS (#16540)

* RETURNTOPOOL AND VARIOUS

* fixes

* forgot a fix

* more fix

* too tired to git

* Sood AKA that guy that always tries to fix GC even though he forgets how it works every time and he always does it late at night in a hurry

* cluster knows best
This commit is contained in:
sood
2017-11-26 10:39:24 -08:00
committed by Pieter-Jan Briers
parent ada12cfc5c
commit dfca3d35e3
14 changed files with 28 additions and 18 deletions

View File

@@ -21,6 +21,7 @@
if(M.client.buildmode_objs && M.client.buildmode_objs.len) if(M.client.buildmode_objs && M.client.buildmode_objs.len)
for(var/BM in M.client.buildmode_objs) for(var/BM in M.client.buildmode_objs)
returnToPool(BM) returnToPool(BM)
M.client.buildmode_objs.Cut()
else else
log_admin("[key_name(usr)] has entered build mode.") log_admin("[key_name(usr)] has entered build mode.")
M.client.buildmode = 1 M.client.buildmode = 1

View File

@@ -172,6 +172,7 @@ var/global/obj/abstract/screen/clicker/catcher = new()
adding -= IN adding -= IN
mymob.client.screen -= IN mymob.client.screen -= IN
hand_hud_objects -= IN
returnToPool(IN) returnToPool(IN)
if(mymob.client) if(mymob.client)

View File

@@ -73,6 +73,7 @@
if(materials) if(materials)
returnToPool(materials) returnToPool(materials)
materials = null
if(on_moved) if(on_moved)
on_moved.holder = null on_moved.holder = null

View File

@@ -414,6 +414,7 @@
connected = null connected = null
for(var/datum/block_label/label in labels) for(var/datum/block_label/label in labels)
returnToPool(label) returnToPool(label)
labels.Cut()
buffers.Cut() buffers.Cut()
if(disk) if(disk)
qdel(disk) qdel(disk)

View File

@@ -52,6 +52,7 @@
return return
if(!path) if(!path)
returnToPool(verb_holder) returnToPool(verb_holder)
verb_holder = null
return return
verb_holder.verbs -= path verb_holder.verbs -= path
@@ -197,6 +198,7 @@
verb_holder.verbs -= P.verbpath verb_holder.verbs -= P.verbpath
returnToPool(verb_holder) returnToPool(verb_holder)
verb_holder = null
//Helper proc. Does all the checks and stuff for us to avoid copypasta //Helper proc. Does all the checks and stuff for us to avoid copypasta

View File

@@ -315,4 +315,4 @@ send an additional command to open the door again.
#undef TARGET_NONE #undef TARGET_NONE
#undef TARGET_INOPEN #undef TARGET_INOPEN
#undef TARGET_OUTOPEN #undef TARGET_OUTOPEN

View File

@@ -85,6 +85,7 @@
/obj/machinery/smartfridge/Destroy() /obj/machinery/smartfridge/Destroy()
for(var/key in piles) for(var/key in piles)
returnToPool(piles[key]) returnToPool(piles[key])
piles.Cut()
..() ..()
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj, var/mob/user as mob)

View File

@@ -183,6 +183,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \
if(prob(50)) //Fail if(prob(50)) //Fail
getFromPool(/obj/item/stack/cable_coil, C.loc, 1) getFromPool(/obj/item/stack/cable_coil, C.loc, 1)
returnToPool(C) returnToPool(C)
return // let's not return the reference to a pooled cable
return C //What was our last known position? return C //What was our last known position?

View File

@@ -86,7 +86,7 @@
/obj/item/weapon/rcl/proc/is_empty(mob/user) /obj/item/weapon/rcl/proc/is_empty(mob/user)
update_icon() update_icon()
if(!loaded.amount) if(loaded && !loaded.amount)
to_chat(user, "<span class='notice'>The last of the cables unreel from \the [src].</span>") to_chat(user, "<span class='notice'>The last of the cables unreel from \the [src].</span>")
returnToPool(loaded) returnToPool(loaded)
loaded = null loaded = null

View File

@@ -276,6 +276,7 @@
overlays.len = 0 //Once it's been on for a while, in addition to handling the water overlay. overlays.len = 0 //Once it's been on for a while, in addition to handling the water overlay.
if(mymist) if(mymist)
returnToPool(mymist) returnToPool(mymist)
mymist = null
if(on) if(on)
var/image/water = image('icons/obj/watercloset.dmi', src, "water", BELOW_OBJ_LAYER, dir) var/image/water = image('icons/obj/watercloset.dmi', src, "water", BELOW_OBJ_LAYER, dir)
@@ -297,6 +298,7 @@
spawn(250) spawn(250)
if(src && !on) if(src && !on)
returnToPool(mymist) returnToPool(mymist)
mymist = null
ismist = 0 ismist = 0
/obj/machinery/shower/Crossed(atom/movable/O) /obj/machinery/shower/Crossed(atom/movable/O)

View File

@@ -365,9 +365,9 @@ turf/simulated/floor/update_icon()
if(floor_tile) if(floor_tile)
//qdel(floor_tile) //qdel(floor_tile)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null
icon_plating = "plating" icon_plating = "plating"
set_light(0) set_light(0)
floor_tile = null
intact = 0 intact = 0
broken = 0 broken = 0
burnt = 0 burnt = 0
@@ -388,7 +388,7 @@ turf/simulated/floor/update_icon()
set_light(0) set_light(0)
if(floor_tile) if(floor_tile)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null floor_tile = null
if(T) if(T)
if(istype(T,/obj/item/stack/tile/plasteel)) if(istype(T,/obj/item/stack/tile/plasteel))
floor_tile = T floor_tile = T
@@ -418,7 +418,7 @@ turf/simulated/floor/update_icon()
plane = TURF_PLANE plane = TURF_PLANE
if(floor_tile) if(floor_tile)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null floor_tile = null
if(T) if(T)
if(istype(T,/obj/item/stack/tile/light)) if(istype(T,/obj/item/stack/tile/light))
floor_tile = T floor_tile = T
@@ -440,7 +440,7 @@ turf/simulated/floor/update_icon()
plane = TURF_PLANE plane = TURF_PLANE
if(floor_tile) if(floor_tile)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null floor_tile = null
if(T) if(T)
if(istype(T,/obj/item/stack/tile/grass)) if(istype(T,/obj/item/stack/tile/grass))
floor_tile = T floor_tile = T
@@ -461,7 +461,7 @@ turf/simulated/floor/update_icon()
plane = TURF_PLANE plane = TURF_PLANE
if(floor_tile) if(floor_tile)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null floor_tile = null
if(T) if(T)
if(istype(T,/obj/item/stack/tile/wood)) if(istype(T,/obj/item/stack/tile/wood))
floor_tile = T floor_tile = T
@@ -482,7 +482,7 @@ turf/simulated/floor/update_icon()
plane = TURF_PLANE plane = TURF_PLANE
if(floor_tile) if(floor_tile)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null floor_tile = null
if(T) if(T)
if(istype(T,/obj/item/stack/tile/carpet)) if(istype(T,/obj/item/stack/tile/carpet))
floor_tile = T floor_tile = T
@@ -573,10 +573,10 @@ turf/simulated/floor/update_icon()
if(!broken && !burnt) if(!broken && !burnt)
var/obj/item/stack/tile/T = C var/obj/item/stack/tile/T = C
if(T.use(1)) if(T.use(1))
if(floor_tile) if(floor_tile && floor_tile.type != T.type)
returnToPool(floor_tile) returnToPool(floor_tile)
floor_tile = null floor_tile = null
floor_tile = getFromPool(T.type, null) floor_tile = getFromPool(T.type, null)
material = floor_tile.material material = floor_tile.material
intact = 1 intact = 1
plane = TURF_PLANE plane = TURF_PLANE

View File

@@ -42,8 +42,7 @@
spark(user, 5) spark(user, 5)
if(L.damage <= 0) if(L.damage <= 0)
returnToPool(L) returnToPool(L)
//del(L) else
if(L)
playsound(get_turf(src), 'sound/effects/eleczap.ogg', 75, 1) playsound(get_turf(src), 'sound/effects/eleczap.ogg', 75, 1)
L.tang = adjustAngle(get_angle(U,T)) L.tang = adjustAngle(get_angle(U,T))
L.icon = midicon L.icon = midicon
@@ -163,12 +162,12 @@
item_state = "white" item_state = "white"
_color = "mime" _color = "mime"
species_fit = list(VOX_SHAPED) species_fit = list(VOX_SHAPED)
/obj/item/clothing/gloves/white/advanced //mime traitor gloves, spawn in a silent hand gun with two shots /obj/item/clothing/gloves/white/advanced //mime traitor gloves, spawn in a silent hand gun with two shots
actions_types = list(/datum/action/item_action/toggle_gun) actions_types = list(/datum/action/item_action/toggle_gun)
var/obj/item/weapon/gun/projectile/handgun/current_gun = null var/obj/item/weapon/gun/projectile/handgun/current_gun = null
var/charging = FALSE var/charging = FALSE
/obj/item/clothing/gloves/white/advanced/attack_self(mob/user) /obj/item/clothing/gloves/white/advanced/attack_self(mob/user)
var/mob/living/carbon/human/M = user var/mob/living/carbon/human/M = user
if(!istype(M)) if(!istype(M))
@@ -194,7 +193,7 @@
to_chat(M, "<span class = 'warning'> Your hand is full! </span>") to_chat(M, "<span class = 'warning'> Your hand is full! </span>")
else else
to_chat(M, "<span class ='warning'>You need to regain your focus before channeling another gun!</span>") to_chat(M, "<span class ='warning'>You need to regain your focus before channeling another gun!</span>")
/obj/item/clothing/gloves/white/stunglove // For Clown Planet's mimes. - N3X /obj/item/clothing/gloves/white/stunglove // For Clown Planet's mimes. - N3X
New() New()
..() ..()

View File

@@ -88,6 +88,7 @@
/obj/item/weapon/disk/data/Destroy() /obj/item/weapon/disk/data/Destroy()
for(var/datum/block_label/label in labels) for(var/datum/block_label/label in labels)
returnToPool(label) returnToPool(label)
labels.Cut()
..() ..()
/obj/item/weapon/disk/data/proc/Initialize() /obj/item/weapon/disk/data/proc/Initialize()

View File

@@ -278,7 +278,7 @@
assailant = null assailant = null
if(hud) if(hud)
returnToPool(hud) returnToPool(hud)
hud = null hud = null
..() ..()
/mob/proc/grab_check(mob/victim) /mob/proc/grab_check(mob/victim)