From 9a5546867b1d602a1d22bcfacfa64720e0691cc6 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 28 Mar 2021 18:26:40 -0700 Subject: [PATCH] 3DS: Fix memory leak --- src/platform/3ds/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/3ds/main.c b/src/platform/3ds/main.c index afcfe600eca..e9626fa77c8 100644 --- a/src/platform/3ds/main.c +++ b/src/platform/3ds/main.c @@ -301,7 +301,7 @@ static void _setup(struct mGUIRunner* runner) { _map3DSKey(&runner->core->inputMap, KEY_L, GBA_KEY_L); _map3DSKey(&runner->core->inputMap, KEY_R, GBA_KEY_R); - outputBuffer = linearMemAlign(256 * 224 * sizeof(color_t), 0x80); + memset(outputBuffer, 0, 256 * 224 * sizeof(color_t)); runner->core->setVideoBuffer(runner->core, outputBuffer, 256); unsigned mode; @@ -882,6 +882,7 @@ int main() { _cleanup(); return 1; } + outputBuffer = linearMemAlign(256 * 224 * sizeof(color_t), 0x80); struct mGUIRunner runner = { .params = {