Merge pull request #75188 from RedworkDE/net-synchronize-insert
C#: Synchronize adding ScriptInstances
This commit is contained in:
commit
e2fcc4de34
1 changed files with 4 additions and 1 deletions
|
|
@ -1576,7 +1576,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…
Add table
Add a link
Reference in a new issue