2
0
Fork 0

C#: Synchronize adding ScriptInstances

4.1
RedworkDE 2023-03-21 17:14:29 +07:00
parent 903dda8337
commit 8fdebb85ef
1 changed files with 4 additions and 1 deletions

@ -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;
}