Fix false reporting unclaimed StringName at exit due to static refs

This commit is contained in:
Ignacio Roldán Etcheverry 2022-01-20 22:09:03 +01:00 committed by GitHub
parent d681d99e12
commit 0e659b4230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -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));
}
}
}