From 4b4d5b59e5c43c4ffac3a49751663a1c783a3e16 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 9 Nov 2020 00:08:36 -0800 Subject: [PATCH] Debugger: Close trace log when done tracing --- CHANGES | 1 + src/debugger/cli-debugger.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 2802b7f7f..e97610ad3 100644 --- a/CHANGES +++ b/CHANGES @@ -48,6 +48,7 @@ Other fixes: - CMake: Fix build with downstream minizip that exports incompatible symbols - Core: Ensure ELF regions can be written before trying - Debugger: Don't skip undefined instructions when debugger attached + - Debugger: Close trace log when done tracing - FFmpeg: Fix some small memory leaks - FFmpeg: Fix encoding of time base - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) diff --git a/src/debugger/cli-debugger.c b/src/debugger/cli-debugger.c index c2748d913..823073724 100644 --- a/src/debugger/cli-debugger.c +++ b/src/debugger/cli-debugger.c @@ -752,7 +752,12 @@ static bool _doTrace(struct CLIDebugger* debugger) { if (debugger->traceRemaining > 0) { --debugger->traceRemaining; } - return debugger->traceRemaining != 0; + if (!debugger->traceRemaining) { + debugger->traceVf->close(debugger->traceVf); + debugger->traceVf = NULL; + return false; + } + return true; } static void _printStatus(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {