diff options
author | santouits <santouits@users.noreply.github.com> | 2019-07-28 23:19:44 +0300 |
---|---|---|
committer | santouits <santouits@users.noreply.github.com> | 2019-07-30 19:08:33 +0300 |
commit | 13efc1bb062a64d513618b136bfd3d888adb2ec5 (patch) | |
tree | ac09c1a5fb65db627a6d9466f0e514a9965c983e | |
parent | becbb7b525e1cc9bf1520a0ac94b9e9f799f6169 (diff) |
Hopefully fix the random crashes with threads
-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; } }; |