Merge pull request #116684 from Calinou/objectdb-instance-leak-warning-tweak

Tweak ObjectDB instance leak warning message to mention object count
This commit is contained in:
Rémi Verschelde 2026-03-02 12:35:36 +01:00
commit c830bf70ce
No known key found for this signature in database
GPG key ID: C3336907360768E1
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,

View file

@ -46,7 +46,10 @@ if file_contents.find("ERROR: LeakSanitizer:") != -1:
# this possibility should also be handled as a potential error, even if
# LeakSanitizer doesn't report anything
if file_contents.find("ObjectDB instances leaked at exit") != -1:
if (
file_contents.find("ObjectDB instance was leaked at exit") != -1
or file_contents.find("ObjectDB instances were leaked at exit") != -1
):
print("ERROR: Memory leak was found")
sys.exit(54)