[*] AuPaths finish up cleanup

This commit is contained in:
Reece Wilson 2023-12-23 03:24:21 +00:00
parent 9c86d1c899
commit 2fd41d4142

View File

@ -190,7 +190,6 @@ namespace Aurora::Process
{
static AuString cachedModule, cachedPartialPath, cachedFullPath;
static AuInitOnce gInitOnce;
static bool bFailed {};
if (!AuThreading::InitOnceLocker::TryLock(&gInitOnce, true))
{
@ -198,6 +197,8 @@ namespace Aurora::Process
}
else
{
bool bFailed {};
try
{
char spitter;
@ -209,16 +210,16 @@ namespace Aurora::Process
{
cachedModule = cachedFullPath.substr(indexA + 1);
cachedPartialPath = cachedFullPath.substr(0, indexA);
if (!cachedPartialPath.ends_with(AuFS::kPathSplitter))
{
cachedPartialPath += AuFS::kPathSplitter;
}
}
else
{
bFailed = true;
}
if (!cachedPartialPath.ends_with(AuFS::kPathSplitter))
{
cachedPartialPath += AuFS::kPathSplitter;
}
}
else
{
@ -234,7 +235,7 @@ namespace Aurora::Process
AuThreading::InitOnceLocker::Finish(&gInitOnce, bFailed);
}
if (bFailed)
if (gInitOnce.IsUninitialized())
{
return false;
}