summaryrefslogtreecommitdiff
path: root/core/string
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <neikeq@users.noreply.github.com>2022-01-20 22:09:03 +0100
committerGitHub <noreply@github.com>2022-01-20 22:09:03 +0100
commit0e659b423095b494cca2eb9fb9b91cc246ac4380 (patch)
treec20cdb157f71d594ee354073af2e1c9849579148 /core/string
parentd681d99e126bcac87823510ba2a71af0ace6e8dc (diff)
Fix false reporting unclaimed StringName at exit due to static refs
Diffstat (limited to 'core/string')
-rw-r--r--core/string/string_name.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/string/string_name.cpp b/core/string/string_name.cpp
index 61742ac582..11674629fc 100644
--- a/core/string/string_name.cpp
+++ b/core/string/string_name.cpp
@@ -84,12 +84,15 @@ void StringName::cleanup() {
for (int i = 0; i < STRING_TABLE_LEN; i++) {
while (_table[i]) {
_Data *d = _table[i];
- lost_strings++;
- if (d->static_count.get() != d->refcount.get() && OS::get_singleton()->is_stdout_verbose()) {
- if (d->cname) {
- print_line("Orphan StringName: " + String(d->cname));
- } else {
- print_line("Orphan StringName: " + String(d->name));
+ if (d->static_count.get() != d->refcount.get()) {
+ 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));
+ }
}
}