mirror of
https://github.com/godotengine/godot
synced 2024-09-05 00:58:26 +00:00
C#: Synchronize adding ScriptInstances
This commit is contained in:
parent
903dda8337
commit
8fdebb85ef
|
@ -1533,7 +1533,10 @@ CSharpInstance *CSharpInstance::create_for_managed_type(Object *p_owner, CSharpS
|
|||
instance->_reference_owner_unsafe();
|
||||
}
|
||||
|
||||
p_script->instances.insert(p_owner);
|
||||
{
|
||||
MutexLock lock(CSharpLanguage::get_singleton()->get_script_instances_mutex());
|
||||
p_script->instances.insert(p_owner);
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue