From ef1041a47f127fb43c4aa2808bfbf5fb02b376db Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 23 Jul 2017 00:01:18 -0700 Subject: [PATCH] Qt: Fix command line debugger closing second game --- CHANGES | 1 + src/platform/qt/DebuggerConsoleController.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 3d9a5d963..40e83aaa0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Bugfixes: - Python: Fix importing .gb or .gba before .core - GBA: Reset active region as needed when loading a ROM + - Qt: Fix command line debugger closing second game Misc: - Qt: Don't rebuild library view if style hasn't changed diff --git a/src/platform/qt/DebuggerConsoleController.cpp b/src/platform/qt/DebuggerConsoleController.cpp index e7c35144a..d012f9e27 100644 --- a/src/platform/qt/DebuggerConsoleController.cpp +++ b/src/platform/qt/DebuggerConsoleController.cpp @@ -39,8 +39,10 @@ void DebuggerConsoleController::enterLine(const QString& line) { } void DebuggerConsoleController::detach() { - m_lines.append(QString()); - m_cond.wakeOne(); + if (m_cliDebugger.d.state != DEBUGGER_SHUTDOWN) { + m_lines.append(QString()); + m_cond.wakeOne(); + } DebuggerController::detach(); } @@ -68,8 +70,10 @@ void DebuggerConsoleController::init(struct CLIDebuggerBackend* be) { void DebuggerConsoleController::deinit(struct CLIDebuggerBackend* be) { Backend* consoleBe = reinterpret_cast(be); DebuggerConsoleController* self = consoleBe->self; - self->m_lines.append(QString()); - self->m_cond.wakeOne(); + if (be->p->d.state != DEBUGGER_SHUTDOWN) { + self->m_lines.append(QString()); + self->m_cond.wakeOne(); + } } const char* DebuggerConsoleController::readLine(struct CLIDebuggerBackend* be, size_t* len) {