Merge remote-tracking branch 'origin/master' into 1.2

This commit is contained in:
Wojtek Figat
2021-03-30 17:58:29 +02:00
38 changed files with 303 additions and 109 deletions

View File

@@ -408,16 +408,20 @@ Asset* Content::LoadAsync(const StringView& path, MClass* type)
Asset* Content::LoadAsync(const StringView& path, const ScriptingTypeHandle& type)
{
// Ensure path is in a valid format
String pathNorm(path);
FileSystem::NormalizePath(pathNorm);
#if USE_EDITOR
if (!FileSystem::FileExists(path))
if (!FileSystem::FileExists(pathNorm))
{
LOG(Error, "Missing file \'{0}\'", path);
LOG(Error, "Missing file \'{0}\'", pathNorm);
return nullptr;
}
#endif
AssetInfo assetInfo;
if (GetAssetInfo(path, assetInfo))
if (GetAssetInfo(pathNorm, assetInfo))
{
return LoadAsync(assetInfo.ID, type);
}

View File

@@ -194,13 +194,13 @@ void FlaxStorage::AddRef()
void FlaxStorage::RemoveRef()
{
ASSERT(_refCount > 0);
_refCount--;
if (_refCount == 0)
if (_refCount > 0)
{
_lastRefLostTime = DateTime::NowUTC();
_refCount--;
if (_refCount == 0)
{
_lastRefLostTime = DateTime::NowUTC();
}
}
}