mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #11181 from GinjaNinja32/crash_with
Add proc/crash_with, fix two incorrect qdel calls
This commit is contained in:
@@ -1309,3 +1309,7 @@ var/mob/dview/dview_mob = new
|
|||||||
/mob/dview/New()
|
/mob/dview/New()
|
||||||
// do nothing. we don't want to be in any mob lists; we're a dummy not a mob.
|
// do nothing. we don't want to be in any mob lists; we're a dummy not a mob.
|
||||||
|
|
||||||
|
|
||||||
|
// call to generate a stack trace and print to runtime logs
|
||||||
|
/proc/crash_with(msg)
|
||||||
|
CRASH(msg)
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ var/list/delayed_garbage = list()
|
|||||||
return
|
return
|
||||||
if(!istype(A))
|
if(!istype(A))
|
||||||
warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
|
warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
|
||||||
|
crash_with("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
|
||||||
del(A)
|
del(A)
|
||||||
if(garbage_collector)
|
if(garbage_collector)
|
||||||
garbage_collector.dels++
|
garbage_collector.dels++
|
||||||
|
|||||||
@@ -21,14 +21,10 @@
|
|||||||
if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
|
if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||||
initialize()
|
initialize()
|
||||||
|
|
||||||
/proc/generate_debug_runtime() // Guaranteed to runtime and print a stack trace to the runtime log
|
|
||||||
var/t = 0 // BYOND won't let us do var/t = 1/0 directly, but it's fine with this.
|
|
||||||
t = 1 / t
|
|
||||||
|
|
||||||
/atom/movable/Del()
|
/atom/movable/Del()
|
||||||
if(isnull(gcDestroyed) && loc)
|
if(isnull(gcDestroyed) && loc)
|
||||||
testing("GC: -- [type] was deleted via del() rather than qdel() --")
|
testing("GC: -- [type] was deleted via del() rather than qdel() --")
|
||||||
generate_debug_runtime() // stick a stack trace in the runtime logs
|
crash_with("GC: -- [type] was deleted via del() rather than qdel() --") // stick a stack trace in the runtime logs
|
||||||
// else if(isnull(gcDestroyed))
|
// else if(isnull(gcDestroyed))
|
||||||
// testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel()
|
// testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel()
|
||||||
// else
|
// else
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
|||||||
message_admins("\blue [key_name_admin(user)] has edited [key]'s notes.")
|
message_admins("\blue [key_name_admin(user)] has edited [key]'s notes.")
|
||||||
log_admin("[key_name(user)] has edited [key]'s notes.")
|
log_admin("[key_name(user)] has edited [key]'s notes.")
|
||||||
|
|
||||||
qdel(info)
|
del(info) // savefile, so NOT qdel
|
||||||
|
|
||||||
//Updating list of keys with notes on them
|
//Updating list of keys with notes on them
|
||||||
var/savefile/note_list = new("data/player_notes.sav")
|
var/savefile/note_list = new("data/player_notes.sav")
|
||||||
@@ -115,7 +115,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
|||||||
if(!note_keys) note_keys = list()
|
if(!note_keys) note_keys = list()
|
||||||
if(!note_keys.Find(key)) note_keys += key
|
if(!note_keys.Find(key)) note_keys += key
|
||||||
note_list << note_keys
|
note_list << note_keys
|
||||||
qdel(note_list)
|
del(note_list) // savefile, so NOT qdel
|
||||||
|
|
||||||
|
|
||||||
/proc/notes_del(var/key, var/index)
|
/proc/notes_del(var/key, var/index)
|
||||||
|
|||||||
Reference in New Issue
Block a user