Fix memory leak in msgpipe when loading state.

This commit is contained in:
Unknown W. Brackets committed 2012-12-28 13:55:31 -08:00
1 parent e665618891
commit 644e6b615c
1 file changed
+7 -4
+7 -4
View File
@@ -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);