Merge pull request #11181 from GinjaNinja32/crash_with

Add proc/crash_with, fix two incorrect qdel calls
This commit is contained in:
PsiOmegaDelta
2015-09-25 06:31:38 +02:00
4 changed files with 8 additions and 7 deletions

View File

@@ -1309,3 +1309,7 @@ var/mob/dview/dview_mob = new
/mob/dview/New()
// 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)

View File

@@ -91,6 +91,7 @@ var/list/delayed_garbage = list()
return
if(!istype(A))
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)
if(garbage_collector)
garbage_collector.dels++

View File

@@ -21,14 +21,10 @@
if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
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()
if(isnull(gcDestroyed) && loc)
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))
// testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel()
// else

View File

@@ -106,7 +106,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
message_admins("\blue [key_name_admin(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
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.Find(key)) note_keys += key
note_list << note_keys
qdel(note_list)
del(note_list) // savefile, so NOT qdel
/proc/notes_del(var/key, var/index)