Fix leaking exi devices.

This commit is contained in:
Rachel Bryk 2014-07-15 15:20:05 -04:00
parent ebd029973a
commit ed5169c5eb
4 changed files with 11 additions and 5 deletions

View File

@ -53,9 +53,9 @@ CEXIETHERNET::~CEXIETHERNET()
{
Deactivate();
delete tx_fifo;
delete mBbaMem;
delete mRecvBuffer;
delete[] tx_fifo;
delete[] mBbaMem;
delete[] mRecvBuffer;
}
void CEXIETHERNET::SetCS(int cs)

View File

@ -182,7 +182,7 @@ CEXIMemoryCard::~CEXIMemoryCard()
{
CoreTiming::RemoveEvent(et_this_card);
memorycard->Flush(true);
memorycard.release();
memorycard.reset();
}
bool CEXIMemoryCard::IsPresent()

View File

@ -69,6 +69,12 @@ MemoryCard::MemoryCard(std::string filename, int _card_index, u16 sizeMb)
}
}
MemoryCard::~MemoryCard()
{
Flush(true);
delete[] memory_card_content;
}
void MemoryCard::joinThread()
{
if (flushThread.joinable())

View File

@ -21,7 +21,7 @@ class MemoryCard : public MemoryCardBase
{
public:
MemoryCard(std::string filename, int _card_index, u16 sizeMb = MemCard2043Mb);
~MemoryCard() { Flush(true); }
~MemoryCard();
void Flush(bool exiting = false) override;
s32 Read(u32 address, s32 length, u8 *destaddress) override;