This commit is contained in:
Wojtek Figat
2021-07-06 11:13:43 +02:00
parent 687fa325fa
commit 43e5805e50
3 changed files with 12 additions and 28 deletions

View File

@@ -986,25 +986,17 @@ Asset* Content::load(const Guid& id, const ScriptingTypeHandle& type, AssetInfo&
#endif
// Register asset
{
AssetsLocker.Lock();
ASSERT(result->GetID() == id);
AssetsLocker.Lock();
#if ASSETS_LOADING_EXTRA_VERIFICATION
// Asset id has to be unique
if (Assets.ContainsKey(id))
{
CRASH;
}
#endif
// Add to the list
ASSERT(result->GetID() == id);
Assets.Add(id, result);
AssetsLocker.Unlock();
// Asset id has to be unique
if (Assets.ContainsKey(id))
{
CRASH;
}
#endif
Assets.Add(id, result);
AssetsLocker.Unlock();
// Start asset loading
result->startLoading();