mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 11:54:30 +01:00
Fix memory leak in msgpipe when loading state.
This commit is contained in:
1 parent
e665618891
commit
644e6b615c
1 file changed
+7
-4
@@ -56,6 +56,13 @@ struct MsgPipe : public KernelObject
|
||||
static u32 GetMissingErrorCode() { return SCE_KERNEL_ERROR_UNKNOWN_MPPID; }
|
||||
int GetIDType() const { return SCE_KERNEL_TMID_Mpipe; }
|
||||
|
||||
MsgPipe() : buffer(NULL) {}
|
||||
~MsgPipe()
|
||||
{
|
||||
if (buffer != NULL)
|
||||
delete [] buffer;
|
||||
}
|
||||
|
||||
void AddWaitingThread(std::vector<MsgPipeWaitingThread> &list, SceUID id, u32 addr, u32 size, int waitMode, u32 transferredBytesAddr, bool usePrio)
|
||||
{
|
||||
MsgPipeWaitingThread thread = { id, addr, size, size, waitMode, transferredBytesAddr };
|
||||
@@ -211,10 +218,6 @@ void sceKernelDeleteMsgPipe()
|
||||
RETURN(error);
|
||||
return;
|
||||
}
|
||||
if (m->buffer != 0)
|
||||
{
|
||||
delete [] m->buffer;
|
||||
}
|
||||
for (u32 i = 0; i < m->sendWaitingThreads.size(); i++)
|
||||
{
|
||||
__KernelResumeThreadFromWait(m->sendWaitingThreads[i].id);
|
||||
|
||||
Reference in new issue
Block a user