Skip to content

Commit

Permalink
Merge pull request #18283 from unknownbrackets/hle-helper
Browse files Browse the repository at this point in the history
Thread: Reduce thread stop freeing on shutdown
  • Loading branch information
hrydgard committed Oct 1, 2023
2 parents 8bdcd89 + 0a4f1dc commit 74430ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Core/HLE/scePsmf.cpp
Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions Core/HLE/sceUtility.cpp
Expand Up @@ -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";
Expand Down

0 comments on commit 74430ae

Please sign in to comment.