mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-01 01:20:40 +00:00
Merge pull request #629 from RachelBryk/mc-leak
Fix leaking memory cards.
This commit is contained in:
commit
79e90a1521
@ -53,9 +53,9 @@ CEXIETHERNET::~CEXIETHERNET()
|
|||||||
{
|
{
|
||||||
Deactivate();
|
Deactivate();
|
||||||
|
|
||||||
delete tx_fifo;
|
delete[] tx_fifo;
|
||||||
delete mBbaMem;
|
delete[] mBbaMem;
|
||||||
delete mRecvBuffer;
|
delete[] mRecvBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEXIETHERNET::SetCS(int cs)
|
void CEXIETHERNET::SetCS(int cs)
|
||||||
|
@ -182,7 +182,7 @@ CEXIMemoryCard::~CEXIMemoryCard()
|
|||||||
{
|
{
|
||||||
CoreTiming::RemoveEvent(et_this_card);
|
CoreTiming::RemoveEvent(et_this_card);
|
||||||
memorycard->Flush(true);
|
memorycard->Flush(true);
|
||||||
memorycard.release();
|
memorycard.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CEXIMemoryCard::IsPresent()
|
bool CEXIMemoryCard::IsPresent()
|
||||||
|
@ -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()
|
void MemoryCard::joinThread()
|
||||||
{
|
{
|
||||||
if (flushThread.joinable())
|
if (flushThread.joinable())
|
||||||
|
@ -21,7 +21,7 @@ class MemoryCard : public MemoryCardBase
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MemoryCard(std::string filename, int _card_index, u16 sizeMb = MemCard2043Mb);
|
MemoryCard(std::string filename, int _card_index, u16 sizeMb = MemCard2043Mb);
|
||||||
~MemoryCard() { Flush(true); }
|
~MemoryCard();
|
||||||
void Flush(bool exiting = false) override;
|
void Flush(bool exiting = false) override;
|
||||||
|
|
||||||
s32 Read(u32 address, s32 length, u8 *destaddress) override;
|
s32 Read(u32 address, s32 length, u8 *destaddress) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user