diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-04-20 19:38:02 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-04-20 19:38:02 -0300 |
commit | 59154cccf9fcf814a21a2596993fb1b6777d3bb7 (patch) | |
tree | 4132620a9d924463dae4b64fea2dde68a14023e7 /core/object.cpp | |
parent | 28c4afeb5733f9ca9725ab2a5f4066af8e02b2a6 (diff) | |
download | redot-engine-59154cccf9fcf814a21a2596993fb1b6777d3bb7.tar.gz |
-Changed Godot exit to be clean.
-Added more debug information on memory cleanliness on exit (if run with -v)
-Fixed several memory leaks, fixes #1731, fixes #755
Diffstat (limited to 'core/object.cpp')
-rw-r--r-- | core/object.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/object.cpp b/core/object.cpp index 0bc2b7ee41..07e24655c2 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -33,6 +33,7 @@ #include "message_queue.h" #include "core_string_names.h" #include "translation.h" +#include "os/os.h" #ifdef DEBUG_ENABLED @@ -1728,8 +1729,20 @@ void ObjectDB::cleanup() { GLOBAL_LOCK_FUNCTION; if (instances.size()) { - + WARN_PRINT("ObjectDB Instances still exist!"); + if (OS::get_singleton()->is_stdout_verbose()) { + const uint32_t *K=NULL; + while((K=instances.next(K))) { + + String node_name; + if (instances[*K]->is_type("Node")) + node_name=" - Node Name: "+String(instances[*K]->call("get_name")); + if (instances[*K]->is_type("Resoucre")) + node_name=" - Resource Name: "+String(instances[*K]->call("get_name"))+" Path: "+String(instances[*K]->call("get_path")); + print_line("Leaked Instance: "+String(instances[*K]->get_type())+":"+itos(*K)+node_name); + } + } } instances.clear(); instance_checks.clear(); |