[+] Shutdown runtime on unsafe main thread termination

[+] Grug will flush everything inline on deinit
[*] Fix bug in BufferedCharConsumer, didn't return char in peak (doh)
This commit is contained in:
Reece Wilson 2022-02-21 03:40:29 +00:00
parent 3f4cf93877
commit cd8cfd4f1c
4 changed files with 10 additions and 1 deletions

View File

@ -32,6 +32,11 @@ namespace Aurora::Exit
SysPushErrorTimeoutError("Program never executed runtime shutdown -> announcing abnormal shutdown");
PostLevel(AuThreads::GetThread(), ETriggerLevel::eProblematicEvent);
PostLevel(AuThreads::GetThread(), ETriggerLevel::eSafeTermination);
if (Aurora::RuntimeHasStarted())
{
Aurora::RuntimeShutdown();
}
}
}

View File

@ -125,6 +125,9 @@ namespace Aurora::Grug
void DeinitGrug()
{
Aurora::Grug::GrugFlushWrites();
Aurora::Grug::GrugFlushFlushs();
gGrugsBigWorld.reset();
gMutex.reset();
gCondVar.reset();

View File

@ -40,6 +40,7 @@ namespace Aurora::IO::Character
return false;
}
out = this->peeked_;
return this->hasNext_;
}

View File

@ -193,7 +193,7 @@ namespace Aurora::Parse
return false;
}
//AuLogDbg("returned {} {}", out, count != 0);
//AuLogDbg("returned {} {}", out, out.size() != 0);
return out.size() != 0;
}