From f4522c3942f45fd3e9711ec2e723ac288cf51377 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 57abc718f..7d73e5288 100644 --- a/CHANGES +++ b/CHANGES @@ -44,6 +44,7 @@ Other fixes: - FFmpeg: Fix encoding of time base - GBA: Disable more checks when loading GS save with checks disabled (fixes mgba.io/i/1851) - GBA: Fix endianness issues in renderer proxy + - GBA Core: Fix memory leak when loading symbols - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) - Qt: Fix static compilation in MinGW (fixes mgba.io/i/1769) - Qt: Fix a race condition in the frame inspector diff --git a/src/gba/core.c b/src/gba/core.c index f78786562..50241bc56 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -220,6 +220,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);