aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index 16e8435..29da046 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -565,11 +565,15 @@ bool Init()
{
if (!NDSCart_SRAM::Init()) return false;
+ CartROM = NULL;
+
return true;
}
void DeInit()
{
+ if (CartROM) delete[] CartROM;
+
NDSCart_SRAM::DeInit();
}
@@ -606,6 +610,8 @@ bool LoadROM(const char* path, bool direct)
// TODO: streaming mode? for really big ROMs or systems with limited RAM
// for now we're lazy
+ if (CartROM) delete[] CartROM;
+
FILE* f = fopen(path, "rb");
if (!f)
{