Qt: Handle interrupting CLI debugger better (fixes #697)
Vicki Pfau vi@endrift.com
Sat, 22 Apr 2017 18:40:55 -0700
1 files changed,
5 insertions(+),
4 deletions(-)
M
src/platform/qt/DebuggerConsoleController.cpp
→
src/platform/qt/DebuggerConsoleController.cpp
@@ -80,10 +80,11 @@ QMutexLocker lock(&self->m_mutex);
while (self->m_lines.isEmpty()) { self->m_cond.wait(&self->m_mutex); } - self->m_last = self->m_lines.takeFirst().toUtf8(); - if (self->m_last.isEmpty()) { - self->m_last = "\n"; + QString last = self->m_lines.takeFirst(); + if (last.isNull()) { + return nullptr; } + self->m_last = last.toUtf8(); *len = self->m_last.size(); return self->m_last.constData();@@ -101,7 +102,7 @@ DebuggerConsoleController* self = consoleBe->self;
GameController::Interrupter interrupter(self->m_gameController, true); QMutexLocker lock(&self->m_mutex); if (self->m_history.isEmpty()) { - return "\n"; + return "i"; } self->m_last = self->m_history.last().toUtf8(); return self->m_last.constData();