Skip to content

Commit

Permalink
Merge pull request #85464 from KoBeWi/only_say_verbose_when_not_verbose
Browse files Browse the repository at this point in the history
Improve message about resources in use at exit
  • Loading branch information
YuriSizov committed Dec 19, 2023
2 parents 1c0be67 + f8f8fe0 commit d8a65b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/io/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,14 @@ RWLock ResourceCache::path_cache_lock;
#endif

void ResourceCache::clear() {
if (resources.size()) {
ERR_PRINT("Resources still in use at exit (run with --verbose for details).");
if (!resources.is_empty()) {
if (OS::get_singleton()->is_stdout_verbose()) {
ERR_PRINT(vformat("%d resources still in use at exit.", resources.size()));
for (const KeyValue<String, Resource *> &E : resources) {
print_line(vformat("Resource still in use: %s (%s)", E.key, E.value->get_class()));
}
} else {
ERR_PRINT(vformat("%d resources still in use at exit (run with --verbose for details).", resources.size()));
}
}

Expand Down

0 comments on commit d8a65b3

Please sign in to comment.