From e902a253946efa4abcd2c8c930a7733998c5f337 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 8 Aug 2020 04:33:57 -0700 Subject: [PATCH] 3DS: Fix crash with libctru 2.0 when exiting --- CHANGES | 1 + src/platform/3ds/main.c | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index ec6f0b803..4060f6dc2 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,7 @@ Emulation fixes: - SM83: Emulate HALT bug Other fixes: - 3DS: Redo video sync to be more precise + - 3DS: Fix crash with libctru 2.0 when exiting - All: Improve export headers (fixes mgba.io/i/1738) - Core: Ensure ELF regions can be written before trying - Debugger: Don't skip undefined instructions when debugger attached diff --git a/src/platform/3ds/main.c b/src/platform/3ds/main.c index acb9c3527..bcaa568e1 100644 --- a/src/platform/3ds/main.c +++ b/src/platform/3ds/main.c @@ -107,7 +107,6 @@ static C3D_Tex upscaleBufferTex; static bool interframeBlending = false; static bool sgbCrop = false; -static aptHookCookie cookie; static bool core2; static bool _initGpu(void) { @@ -190,18 +189,6 @@ static void _cleanup(void) { ptmuExit(); } -static void _aptHook(APT_HookType hook, void* user) { - UNUSED(user); - switch (hook) { - case APTHOOK_ONEXIT: - _cleanup(); - exit(0); - break; - default: - break; - } -} - static void _map3DSKey(struct mInputMap* map, int ctrKey, enum GBAKey key) { mInputBindKey(map, _3DS_INPUT, __builtin_ctz(ctrKey), key); } @@ -826,8 +813,6 @@ int main() { camera.bufferSize = 0; camera.cam = SELECT_IN1; - aptHook(&cookie, _aptHook, 0); - ptmuInit(); camInit();