Thread: Reduce thread stop freeing on shutdown.

Seeing errors for helper threads not existing, so let's try skipping
delete on shutdown.  They already get freed anyway.
This commit is contained in:
Unknown W. Brackets 2023-01-22 17:53:45 -08:00
parent aedd51f2f6
commit 0a4f1dc49b
2 changed files with 7 additions and 1 deletions

View file

@ -740,8 +740,12 @@ void __PsmfPlayerDoState(PointerWrap &p) {
void __PsmfShutdown() {
for (auto it = psmfMap.begin(), end = psmfMap.end(); it != end; ++it)
delete it->second;
for (auto it = psmfPlayerMap.begin(), end = psmfPlayerMap.end(); it != end; ++it)
for (auto it = psmfPlayerMap.begin(), end = psmfPlayerMap.end(); it != end; ++it) {
// Don't bother freeing, may already be freed.
if (it->second->finishThread)
it->second->finishThread->Forget();
delete it->second;
}
psmfMap.clear();
psmfPlayerMap.clear();
}

View file

@ -304,6 +304,8 @@ void __UtilityShutdown() {
npSigninDialog->Shutdown(true);
if (accessThread) {
// Don't need to free it during shutdown, may have already been freed.
accessThread->Forget();
delete accessThread;
accessThread = nullptr;
accessThreadState = "shutdown";