summaryrefslogtreecommitdiff
path: root/core/string_db.cpp
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2015-07-29 23:01:36 +0300
committerAnton Yabchinskiy <arn@bestmx.ru>2015-07-29 23:01:36 +0300
commitdc8df8a91a995796f0f330bf6bb6b209f6dfce08 (patch)
tree46cfe09124703b07860754d6b44e0289422e0573 /core/string_db.cpp
parent16746f157f83d666079ba3266acec13d35b84c3f (diff)
parent922356b903061cda7591090bf19e8346c3a78cf5 (diff)
Merge branch 'master' of github.com:okamstudio/godot
Diffstat (limited to 'core/string_db.cpp')
-rw-r--r--core/string_db.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/core/string_db.cpp b/core/string_db.cpp
index ffb7dc194b..b48d9f37d4 100644
--- a/core/string_db.cpp
+++ b/core/string_db.cpp
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -28,7 +28,7 @@
/*************************************************************************/
#include "string_db.h"
#include "print_string.h"
-
+#include "os/os.h"
StaticCString StaticCString::create(const char *p_ptr) {
StaticCString scs; scs.ptr=p_ptr; return scs;
}
@@ -55,15 +55,29 @@ void StringName::setup() {
void StringName::cleanup() {
_global_lock();
+ int lost_strings=0;
for(int i=0;i<STRING_TABLE_LEN;i++) {
while(_table[i]) {
_Data*d=_table[i];
- _table[i]=_table[i]->next;
+ lost_strings++;
+ if (OS::get_singleton()->is_stdout_verbose()) {
+
+ if (d->cname) {
+ print_line("Orphan StringName: "+String(d->cname));
+ } else {
+ print_line("Orphan StringName: "+String(d->name));
+ }
+ }
+
+ _table[i]=_table[i]->next;
memdelete(d);
}
}
+ if (OS::get_singleton()->is_stdout_verbose() && lost_strings) {
+ print_line("StringName: "+itos(lost_strings)+" unclaimed string names at exit.");
+ }
_global_unlock();
}
@@ -144,7 +158,7 @@ void StringName::operator=(const StringName& p_name) {
_data = p_name._data;
}
}
-
+/* was inlined
StringName::operator String() const {
if (_data)
@@ -152,7 +166,7 @@ StringName::operator String() const {
return "";
}
-
+*/
StringName::StringName(const StringName& p_name) {
ERR_FAIL_COND(!configured);