mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Don't use the destructor to free thread stacks.
If we do, kernelObjects.clear() will trash perfectly good memory on loading a state. I guess it also makes shutdown slower. Fixes #4186.
This commit is contained in:
parent
59bfaa30c7
commit
e06889069c
1 changed files with 4 additions and 1 deletions
|
@ -487,7 +487,8 @@ public:
|
|||
currentStack.start = 0;
|
||||
}
|
||||
|
||||
~Thread()
|
||||
// Can't use a destructor since savestates will call that too.
|
||||
void Cleanup()
|
||||
{
|
||||
// Callbacks are automatically deleted when their owning thread is deleted.
|
||||
for (auto it = callbacks.begin(), end = callbacks.end(); it != end; ++it)
|
||||
|
@ -1798,6 +1799,8 @@ u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason)
|
|||
if (callback && callback->nc.notifyCount != 0)
|
||||
readyCallbacksCount--;
|
||||
}
|
||||
|
||||
t->Cleanup();
|
||||
}
|
||||
|
||||
return kernelObjects.Destroy<Thread>(threadID);
|
||||
|
|
Loading…
Add table
Reference in a new issue