summaryrefslogtreecommitdiff
path: root/core/object.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-08 14:50:47 +0200
committerGitHub <noreply@github.com>2019-08-08 14:50:47 +0200
commit274bac2783bdee5a80d25e0b12f0a54d36ffc276 (patch)
treeecb5438c7e01aa62e9954cf033d9e7b41d852731 /core/object.h
parent4d7439adaafd33b09e9b6e521e0d6af669b1e2d9 (diff)
parent13efc1bb062a64d513618b136bfd3d888adb2ec5 (diff)
Merge pull request #30934 from santouits/debugg
Hopefully fix the random crashes with threads
Diffstat (limited to 'core/object.h')
-rw-r--r--core/object.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/object.h b/core/object.h
index dce1cc74ae..15c3ab94c5 100644
--- a/core/object.h
+++ b/core/object.h
@@ -794,8 +794,13 @@ public:
static int get_object_count();
_FORCE_INLINE_ static bool instance_validate(Object *p_ptr) {
+ rw_lock->read_lock();
- return instance_checks.has(p_ptr);
+ bool exists = instance_checks.has(p_ptr);
+
+ rw_lock->read_unlock();
+
+ return exists;
}
};