Tweak ObjectDB instance leak warning message to mention object count

This helps assess how important the situation is to resolve
for project developers, without having to run the project with
`--verbose` again.
This commit is contained in:
Hugo Locurcio 2026-02-23 20:49:50 +01:00
parent 1aaea38e7f
commit 77706bffa3
No known key found for this signature in database
GPG key ID: 46ACE49F61685096
2 changed files with 5 additions and 2 deletions

View file

@ -2641,7 +2641,7 @@ void ObjectDB::cleanup() {
spin_lock.lock();
if (slot_count > 0) {
WARN_PRINT("ObjectDB instances leaked at exit (run with --verbose for details).");
WARN_PRINT(vformat("%d ObjectDB %s leaked at exit (run with `--verbose` for details).", slot_count, slot_count == 1 ? "instance was" : "instances were"));
if (OS::get_singleton()->is_stdout_verbose()) {
// Ensure calling the native classes because if a leaked instance has a script
// that overrides any of those methods, it'd not be OK to call them at this point,