mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-12 07:35:31 +01:00
fixes stack memleaks (#18395)
* fixes stack memleaks * . * more * . * . * urg * urg * . * . * . * . * . * . * . * . * . * . * cklear laws * Update vending.dm --------- Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
@@ -25,8 +25,12 @@
|
||||
|
||||
/obj/item/reagent_containers/food/drinks/bottle/Destroy()
|
||||
if(rag)
|
||||
rag.forceMove(src.loc)
|
||||
rag = null
|
||||
var/turf/possible_loc = get_turf(src)
|
||||
if(possible_loc)
|
||||
rag.forceMove(possible_loc)
|
||||
else
|
||||
qdel(rag)
|
||||
rag = null
|
||||
return ..()
|
||||
|
||||
//when thrown on impact, bottles smash and spill their contents
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
matter = material.get_matter()
|
||||
update_strings()
|
||||
|
||||
/obj/item/stack/material/Destroy()
|
||||
material = null
|
||||
. = ..()
|
||||
|
||||
/obj/item/stack/material/get_material()
|
||||
return material
|
||||
|
||||
|
||||
@@ -155,6 +155,8 @@
|
||||
borg.mmi = null
|
||||
QDEL_NULL(radio)
|
||||
QDEL_NULL(brainmob)
|
||||
if(brainobj)
|
||||
QDEL_NULL(brainobj)
|
||||
return ..()
|
||||
|
||||
/obj/item/mmi/radio_enabled
|
||||
|
||||
@@ -240,7 +240,6 @@ var/list/ai_verbs_default = list(
|
||||
QDEL_NULL(aiCommunicator)
|
||||
QDEL_NULL(aiMulti)
|
||||
QDEL_NULL(aiRadio)
|
||||
QDEL_NULL(aiCamera)
|
||||
hack = null
|
||||
|
||||
destroy_eyeobj()
|
||||
|
||||
@@ -36,6 +36,11 @@
|
||||
idle_usage = initial(idle_usage)
|
||||
active_usage = initial(active_usage)
|
||||
|
||||
/datum/robot_component/Destroy(force)
|
||||
if(wrapped)
|
||||
QDEL_NULL(wrapped)
|
||||
. = ..()
|
||||
|
||||
/datum/robot_component/proc/destroy()
|
||||
var/brokenstate = "broken" // Generic icon
|
||||
if (istype(wrapped, /obj/item/robot_parts/robot_component))
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
var/lower_mod = 0
|
||||
var/jetpack = 0
|
||||
var/datum/effect/effect/system/ion_trail_follow/ion_trail = null
|
||||
var/datum/effect/effect/system/spark_spread/spark_system//So they can initialize sparks whenever/N
|
||||
var/datum/effect/effect/system/spark_spread/spark_system //So they can initialize sparks whenever/N
|
||||
var/jeton = 0
|
||||
var/killswitch = 0
|
||||
var/killswitch_time = 60
|
||||
@@ -111,6 +111,7 @@
|
||||
var/braintype = JOB_CYBORG
|
||||
|
||||
var/obj/item/implant/restrainingbolt/bolt // The restraining bolt installed into the cyborg.
|
||||
var/datum/tgui_module/robot_ui/robotact
|
||||
|
||||
var/list/robot_verbs_default = list(
|
||||
/mob/living/silicon/robot/proc/sensor_mode,
|
||||
@@ -306,31 +307,66 @@
|
||||
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
|
||||
//Improved /N
|
||||
/mob/living/silicon/robot/Destroy()
|
||||
if(mmi && mind)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
|
||||
var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
|
||||
if(T) mmi.loc = T
|
||||
if(mmi.brainmob)
|
||||
var/obj/item/robot_module/M = locate() in contents
|
||||
if(M)
|
||||
mmi.brainmob.languages = M.original_languages
|
||||
else
|
||||
mmi.brainmob.languages = languages
|
||||
mmi.brainmob.remove_language(LANGUAGE_ROBOT_TALK)
|
||||
mind.transfer_to(mmi.brainmob)
|
||||
else if(!shell) // Shells don't have brainmbos in their MMIs.
|
||||
to_chat(src, span_danger("Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug."))
|
||||
ghostize()
|
||||
//ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
|
||||
mmi = null
|
||||
if(connected_ai)
|
||||
connected_ai.connected_robots -= src
|
||||
if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside.
|
||||
if(mind)
|
||||
var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
|
||||
if(T)
|
||||
mmi.forceMove(T)
|
||||
if(mmi.brainmob)
|
||||
var/obj/item/robot_module/M = locate() in contents
|
||||
if(M)
|
||||
mmi.brainmob.languages = M.original_languages
|
||||
else
|
||||
mmi.brainmob.languages = languages
|
||||
mmi.brainmob.remove_language(LANGUAGE_ROBOT_TALK)
|
||||
mind.transfer_to(mmi.brainmob)
|
||||
else if(!shell) // Shells don't have brainmbos in their MMIs.
|
||||
to_chat(src, span_danger("Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug."))
|
||||
ghostize()
|
||||
//ERROR("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].")
|
||||
mmi = null
|
||||
else
|
||||
QDEL_NULL(mmi)
|
||||
disconnect_from_ai(TRUE)
|
||||
if(shell)
|
||||
if(deployed)
|
||||
undeploy()
|
||||
revert_shell() // To get it out of the GLOB list.
|
||||
qdel(wires)
|
||||
wires = null
|
||||
QDEL_NULL(wires)
|
||||
sprite_datum = null
|
||||
QDEL_NULL(robotact)
|
||||
QDEL_LIST_ASSOC_VAL(components)
|
||||
if(bolt)
|
||||
QDEL_NULL(bolt)
|
||||
if(module)
|
||||
QDEL_NULL(module)
|
||||
if(radio)
|
||||
QDEL_NULL(radio)
|
||||
if(communicator)
|
||||
QDEL_NULL(communicator)
|
||||
if(cell)
|
||||
QDEL_NULL(cell)
|
||||
if(camera)
|
||||
QDEL_NULL(camera)
|
||||
if(rbPDA)
|
||||
QDEL_NULL(rbPDA)
|
||||
if(inv1)
|
||||
QDEL_NULL(inv1)
|
||||
if(inv2)
|
||||
QDEL_NULL(inv2)
|
||||
if(inv3)
|
||||
QDEL_NULL(inv3)
|
||||
if(robot_modules_background)
|
||||
QDEL_NULL(robot_modules_background)
|
||||
if(ion_trail)
|
||||
QDEL_NULL(ion_trail)
|
||||
if(spark_system)
|
||||
QDEL_NULL(spark_system)
|
||||
module_active = null
|
||||
module_state_1 = null
|
||||
module_state_2 = null
|
||||
module_state_3 = null
|
||||
|
||||
return ..()
|
||||
|
||||
// CONTINUE CODING HERE
|
||||
@@ -862,9 +898,8 @@
|
||||
if(notify)
|
||||
notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, module.name)
|
||||
module.Reset(src)
|
||||
qdel(module)
|
||||
QDEL_NULL(module)
|
||||
icon_selected = FALSE
|
||||
module = null
|
||||
updatename("Default")
|
||||
has_recoloured = FALSE
|
||||
robotact?.update_static_data_for_all_viewers()
|
||||
@@ -1252,9 +1287,10 @@
|
||||
if(ROBOT_NOTIFICATION_AI_SHELL) //New Shell
|
||||
to_chat(connected_ai, span_filter_notice("<br><br>" + span_notice("NOTICE - New AI shell detected: <a href='byond://?src=[REF(connected_ai)];track2=[html_encode(name)]'>[name]</a>") + "<br>"))
|
||||
|
||||
/mob/living/silicon/robot/proc/disconnect_from_ai()
|
||||
/mob/living/silicon/robot/proc/disconnect_from_ai(silent)
|
||||
if(connected_ai)
|
||||
sync() // One last sync attempt
|
||||
if(!silent)
|
||||
sync() // One last sync attempt
|
||||
connected_ai.connected_robots -= src
|
||||
connected_ai = null
|
||||
|
||||
|
||||
@@ -83,15 +83,9 @@
|
||||
R.scrubbing = FALSE
|
||||
|
||||
/obj/item/robot_module/Destroy()
|
||||
for(var/module in modules)
|
||||
qdel(module)
|
||||
for(var/emg in emag)
|
||||
qdel(emg)
|
||||
for(var/synth in synths)
|
||||
qdel(synth)
|
||||
modules.Cut()
|
||||
synths.Cut()
|
||||
emag.Cut()
|
||||
QDEL_LIST(modules)
|
||||
QDEL_LIST(emag)
|
||||
QDEL_LIST(synths)
|
||||
return ..()
|
||||
|
||||
/obj/item/robot_module/emp_act(severity)
|
||||
|
||||
@@ -490,6 +490,10 @@
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/item/robotic_multibelt/materials/Destroy()
|
||||
QDEL_LIST(cyborg_integrated_tools)
|
||||
. = ..()
|
||||
|
||||
///Allows the material fabricator to pick up materials if they hit an appropriate stack.
|
||||
/obj/item/robotic_multibelt/materials/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
if(istype(target, /obj/item/stack)) //We are targeting a stack.
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/mob/living/silicon/robot
|
||||
var/datum/tgui_module/robot_ui/robotact
|
||||
|
||||
// Major Control UI for all things robots can do.
|
||||
/datum/tgui_module/robot_ui
|
||||
name = "Robotact"
|
||||
|
||||
@@ -41,9 +41,16 @@
|
||||
AddElement(/datum/element/footstep, FOOTSTEP_MOB_SHOE, 1, -6)
|
||||
|
||||
/mob/living/silicon/Destroy()
|
||||
common_radio = null // same ref as radio, deleted by child
|
||||
GLOB.silicon_mob_list -= src
|
||||
for(var/datum/alarm_handler/AH in SSalarm.all_handlers)
|
||||
AH.unregister_alarm(src)
|
||||
if(aiCamera)
|
||||
QDEL_NULL(aiCamera)
|
||||
if(idcard)
|
||||
QDEL_NULL(idcard)
|
||||
if(laws)
|
||||
QDEL_NULL(laws)
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/proc/init_id()
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
if(ability_master)
|
||||
QDEL_NULL(ability_master)
|
||||
|
||||
if(vore_organs)
|
||||
if(LAZYLEN(vore_organs))
|
||||
QDEL_NULL_LIST(vore_organs)
|
||||
if(vorePanel)
|
||||
QDEL_NULL(vorePanel)
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
/obj/item/camera/siliconcam/drone_camera //currently doesn't offer the verbs, thus cannot be used
|
||||
name = "Drone photo camera"
|
||||
|
||||
/obj/item/camera/siliconcam/Destroy()
|
||||
QDEL_LIST(aipictures)
|
||||
. = ..()
|
||||
|
||||
/obj/item/camera/siliconcam/proc/injectaialbum(obj/item/photo/p, var/sufix = "") //stores image information to a list similar to that of the datacore
|
||||
p.loc = src
|
||||
photos_taken++
|
||||
@@ -69,6 +73,7 @@
|
||||
return
|
||||
|
||||
aipictures -= selection
|
||||
qdel(selection)
|
||||
to_chat(user, span_unconscious("Local image deleted"))
|
||||
|
||||
/obj/item/camera/siliconcam/ai_camera/can_capture_turf(turf/T, mob/user)
|
||||
|
||||
@@ -19,6 +19,10 @@ Code is pretty much ripped verbatim from nano modules, but with un-needed stuff
|
||||
if(ntos)
|
||||
tgui_id = "Ntos" + tgui_id
|
||||
|
||||
/datum/tgui_module/Destroy(force)
|
||||
host = null
|
||||
. = ..()
|
||||
|
||||
/datum/tgui_module/tgui_host()
|
||||
return host ? host.tgui_host() : src
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
/datum/ticket_chat/tgui_close(mob/user)
|
||||
. = ..()
|
||||
if(user.client.current_ticket)
|
||||
if(user.client?.current_ticket)
|
||||
user.throw_alert("open ticket", /obj/screen/alert/open_ticket)
|
||||
|
||||
/datum/ticket_chat/tgui_state(mob/user)
|
||||
|
||||
@@ -267,6 +267,7 @@
|
||||
var/list/belly_surrounding = list() // A list of living mobs surrounded by this belly, including inside containers, food, on mobs, etc. Exclusing inside other bellies.
|
||||
var/bellytemperature = T20C // Temperature applied to humans in the belly.
|
||||
var/temperature_damage = FALSE // Does temperature damage prey?
|
||||
flags = NOREACT // We dont want bellies to start bubling nonstop due to people mixing when transfering and making different reagents
|
||||
|
||||
//For serialization, keep this updated, required for bellies to save correctly.
|
||||
/obj/belly/vars_to_save()
|
||||
@@ -487,7 +488,7 @@
|
||||
//If not, we're probably just in a prefs list or something.
|
||||
if(ismob(loc))
|
||||
owner = loc
|
||||
owner.vore_organs |= src
|
||||
owner.vore_organs += src
|
||||
if(isliving(loc))
|
||||
if(mode_flags & DM_FLAG_TURBOMODE)
|
||||
START_PROCESSING(SSobj, src)
|
||||
@@ -495,7 +496,6 @@
|
||||
START_PROCESSING(SSbellies, src)
|
||||
|
||||
create_reagents(300) // So we can have some liquids in bellies
|
||||
flags |= NOREACT // We dont want bellies to start bubling nonstop due to people mixing when transfering and making different reagents
|
||||
|
||||
/obj/belly/Destroy()
|
||||
if(mode_flags & DM_FLAG_TURBOMODE)
|
||||
|
||||
Reference in New Issue
Block a user