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)
for(var/BM in M.client.buildmode_objs)
returnToPool(BM)
M.client.buildmode_objs.Cut()
else
log_admin("[key_name(usr)] has entered build mode.")
M.client.buildmode = 1

View File

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

View File

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

View File

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

View File

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

View File

@@ -85,6 +85,7 @@
/obj/machinery/smartfridge/Destroy()
for(var/key in piles)
returnToPool(piles[key])
piles.Cut()
..()
/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
getFromPool(/obj/item/stack/cable_coil, C.loc, 1)
returnToPool(C)
return // let's not return the reference to a pooled cable
return C //What was our last known position?

View File

@@ -86,7 +86,7 @@
/obj/item/weapon/rcl/proc/is_empty(mob/user)
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>")
returnToPool(loaded)
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.
if(mymist)
returnToPool(mymist)
mymist = null
if(on)
var/image/water = image('icons/obj/watercloset.dmi', src, "water", BELOW_OBJ_LAYER, dir)
@@ -297,6 +298,7 @@
spawn(250)
if(src && !on)
returnToPool(mymist)
mymist = null
ismist = 0
/obj/machinery/shower/Crossed(atom/movable/O)

View File

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

View File

@@ -42,8 +42,7 @@
spark(user, 5)
if(L.damage <= 0)
returnToPool(L)
//del(L)
if(L)
else
playsound(get_turf(src), 'sound/effects/eleczap.ogg', 75, 1)
L.tang = adjustAngle(get_angle(U,T))
L.icon = midicon

View File

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

View File

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