diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-08 14:50:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-08 14:50:47 +0200 |
commit | 274bac2783bdee5a80d25e0b12f0a54d36ffc276 (patch) | |
tree | ecb5438c7e01aa62e9954cf033d9e7b41d852731 /core/object.h | |
parent | 4d7439adaafd33b09e9b6e521e0d6af669b1e2d9 (diff) | |
parent | 13efc1bb062a64d513618b136bfd3d888adb2ec5 (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.h | 7 |
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; } }; |