From 7388774f10da8aaa26c5203fa608aefd04fecf5b Mon Sep 17 00:00:00 2001 From: aldelaro5 Date: Sun, 6 May 2018 01:55:30 -0400 Subject: [PATCH] Qt/debugger: fix some possible crashes and inconsistencies in the breakpoint widget One, which was also possible in Wx is to add an mbp after the core stopped which shouldn't be possible as it needs to add the memcheck on the core thread which wouldn't be running. The other fix is Qt specific where it doesn't clear the breakpoints on stop. --- .../Core/DolphinQt2/Debugger/BreakpointWidget.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp index 1eebcfbff7..7f0e81bfc0 100644 --- a/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp @@ -40,8 +40,16 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) if (!Settings::Instance().IsDebugModeEnabled()) return; - m_load->setEnabled(Core::IsRunning()); - m_save->setEnabled(Core::IsRunning()); + bool is_initialised = state != Core::State::Uninitialized; + m_new->setEnabled(is_initialised); + m_load->setEnabled(is_initialised); + m_save->setEnabled(is_initialised); + if (!is_initialised) + { + PowerPC::breakpoints.Clear(); + PowerPC::memchecks.Clear(); + Update(); + } }); connect(&Settings::Instance(), &Settings::BreakpointsVisibilityChanged, @@ -101,6 +109,7 @@ void BreakpointWidget::CreateWidgets() m_load = AddAction(m_toolbar, tr("Load"), this, &BreakpointWidget::OnLoad); m_save = AddAction(m_toolbar, tr("Save"), this, &BreakpointWidget::OnSave); + m_new->setEnabled(false); m_load->setEnabled(false); m_save->setEnabled(false);