summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}
};