Fixed some memory leaks. Only one was mine ;P

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7392 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2011-03-22 07:27:23 +00:00
parent 017735b9ff
commit f8620fcd0b
18 changed files with 89 additions and 99 deletions

View File

@ -41,7 +41,6 @@ DSPEmitter::DSPEmitter() : gpr(*this), storeIndex(-1), storeIndex2(-1)
blocks = new DSPCompiledCode[MAX_BLOCKS];
blockLinks = new Block[MAX_BLOCKS];
blockSize = new u16[MAX_BLOCKS];
unresolvedJumps = new std::list<u16>[MAX_BLOCKS];
compileSR = 0;
compileSR |= SR_INT_ENABLE;

View File

@ -260,7 +260,7 @@ public:
u16 startAddr;
Block *blockLinks;
u16 *blockSize;
std::list<u16> *unresolvedJumps;
std::list<u16> unresolvedJumps[MAX_BLOCKS];
DSPJitRegCache gpr;
private:

View File

@ -18,8 +18,8 @@
#ifndef _DSPEMULATOR_H_
#define _DSPEMULATOR_H_
#include "ChunkFile.h"
#include "SoundStream.h"
class DSPEmulator
{
@ -43,6 +43,9 @@ public:
virtual void DSP_Update(int cycles) = 0;
virtual void DSP_StopSoundStream() = 0;
virtual void DSP_ClearAudioBuffer(bool mute) = 0;
protected:
SoundStream *soundStream;
};
DSPEmulator *CreateDSPEmulator(bool LLE);

View File

@ -61,7 +61,6 @@ private:
bool m_bWii;
bool m_InitMixer;
SoundStream *soundStream;
// Fake mailbox utility
struct DSPState

View File

@ -48,7 +48,6 @@ private:
static void dsp_thread(DSPLLE* lpParameter);
std::thread m_hDSPThread;
SoundStream *soundStream;
bool m_InitMixer;
void *m_hWnd;
bool m_bWii;

View File

@ -117,25 +117,21 @@ bool CWII_IPC_HLE_Device_di::IOCtlV(u32 _CommandAddress)
_dbg_assert_msg_(WII_IPC_DVD, CommandBuffer.InBuffer[1].m_Address == 0, "DVDLowOpenPartition with ticket");
_dbg_assert_msg_(WII_IPC_DVD, CommandBuffer.InBuffer[2].m_Address == 0, "DVDLowOpenPartition with cert chain");
bool readOK = false;
// Get TMD offset for requested partition...
u64 TMDOffset = ((u64)Memory::Read_U32(CommandBuffer.InBuffer[0].m_Address + 4) << 2 ) + 0x2c0;
u64 const TMDOffset = ((u64)Memory::Read_U32(CommandBuffer.InBuffer[0].m_Address + 4) << 2 ) + 0x2c0;
INFO_LOG(WII_IPC_DVD, "DVDLowOpenPartition: TMDOffset 0x%016llx", TMDOffset);
u32 TMDsz = 0x208; //CommandBuffer.PayloadBuffer[0].m_Size;
u8 *pTMD = new u8[TMDsz];
if (pTMD)
{
// Read TMD to the buffer
VolumeHandler::RAWReadToPtr(pTMD, TMDOffset, TMDsz);
static u32 const TMDsz = 0x208; //CommandBuffer.PayloadBuffer[0].m_Size;
u8 pTMD[TMDsz];
memcpy(Memory::GetPointer(CommandBuffer.PayloadBuffer[0].m_Address), pTMD, TMDsz);
readOK |= true;
WII_IPC_HLE_Interface::ES_DIVerify(pTMD, TMDsz);
}
ReturnValue = readOK ? 1 : 0;
// Read TMD to the buffer
VolumeHandler::RAWReadToPtr(pTMD, TMDOffset, TMDsz);
memcpy(Memory::GetPointer(CommandBuffer.PayloadBuffer[0].m_Address), pTMD, TMDsz);
WII_IPC_HLE_Interface::ES_DIVerify(pTMD, TMDsz);
ReturnValue = 1;
}
break;

View File

@ -164,7 +164,7 @@ private:
ACLQ(const u8* data, const size_t size, const u16 conn_handle)
: m_size(size), m_conn_handle(conn_handle)
{
m_buffer = new u8[m_size];
m_buffer = new u8[m_size]; // TODO: memleak
memcpy(m_buffer, data, m_size);
}
};