From 77706bffa362623c14f51a5416f4881f8fb4b7ce Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 23 Feb 2026 20:49:50 +0100 Subject: [PATCH] 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. --- core/object/object.cpp | 2 +- misc/scripts/check_ci_log.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/object/object.cpp b/core/object/object.cpp index 43999ba4cf..2dee1f5c59 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -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, diff --git a/misc/scripts/check_ci_log.py b/misc/scripts/check_ci_log.py index 8c6eba669d..171783e7b3 100755 --- a/misc/scripts/check_ci_log.py +++ b/misc/scripts/check_ci_log.py @@ -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)