From 4dcb28ea703bc111d979ffdb85c7fdb8c5ea3656 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 17 Aug 2020 00:57:33 -0700 Subject: [PATCH] GBA Core: Fix memory leak when loading symbols --- CHANGES | 1 + src/gba/core.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 6ac587587..01541ef70 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,7 @@ Other fixes: - 3DS: Fix crash with libctru 2.0 when exiting - Core: Fix reported ROM size when a fixed buffer size is used - GBA: Disable more checks when loading GS save with checks disabled (fixes mgba.io/i/1851) + - GBA Core: Fix memory leak when loading symbols - Qt: Add dummy English translation file (fixes mgba.io/i/1469) - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer diff --git a/src/gba/core.c b/src/gba/core.c index cf402e2cd..901d25111 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -216,6 +216,11 @@ static void _GBACoreDeinit(struct mCore* core) { #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 mDirectorySetDeinit(&core->dirs); #endif +#ifdef USE_DEBUGGERS + if (core->symbolTable) { + mDebuggerSymbolTableDestroy(core->symbolTable); + } +#endif struct GBACore* gbacore = (struct GBACore*) core; free(gbacore->debuggerPlatform);