Explorar o código

Merge pull request #30934 from santouits/debugg

Hopefully fix the random crashes with threads
Rémi Verschelde %!s(int64=6) %!d(string=hai) anos
pai
achega
274bac2783
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      core/object.h

+ 6 - 1
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;
 	}
 };