Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve message about resources in use at exit #85464

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading