summaryrefslogtreecommitdiffstats
path: root/core/object/object.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-08 18:22:48 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-08 18:22:48 +0200
commit68422ab342abc38ddb730dd8dab6945cf8055ade (patch)
tree077232efc7e346aac367121574c15d68d41a3cf2 /core/object/object.cpp
parent2042420bd7f43bb834316d7ca4631ab2fcfcc820 (diff)
parent1589433e8fb5091961e38f027eae57de9782e8ef (diff)
downloadredot-engine-68422ab342abc38ddb730dd8dab6945cf8055ade.tar.gz
Merge pull request #90913 from RandomShaper/wtp_servers_pro
Apply additional fixes to servers' threading
Diffstat (limited to 'core/object/object.cpp')
-rw-r--r--core/object/object.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp
index ab89f96a0d..dfc8e2a29a 100644
--- a/core/object/object.cpp
+++ b/core/object/object.cpp
@@ -2307,9 +2307,9 @@ void ObjectDB::setup() {
}
void ObjectDB::cleanup() {
- if (slot_count > 0) {
- spin_lock.lock();
+ spin_lock.lock();
+ if (slot_count > 0) {
WARN_PRINT("ObjectDB instances leaked at exit (run with --verbose for details).");
if (OS::get_singleton()->is_stdout_verbose()) {
// Ensure calling the native classes because if a leaked instance has a script
@@ -2340,10 +2340,11 @@ void ObjectDB::cleanup() {
}
print_line("Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).");
}
- spin_lock.unlock();
}
if (object_slots) {
memfree(object_slots);
}
+
+ spin_lock.unlock();
}