From 3e94366fe029299a4384ca0a15c779986727d3ad Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 9 Feb 2020 02:32:04 -0500 Subject: [PATCH] DolphinQt/Debugger: Fix crash with floating debugger windows --- Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | 4 ++-- Source/Core/DolphinQt/Debugger/CodeWidget.cpp | 3 ++- Source/Core/DolphinQt/Debugger/RegisterWidget.cpp | 3 ++- Source/Core/DolphinQt/Debugger/WatchWidget.cpp | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp index 2166d43244..2f12877f15 100644 --- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp @@ -31,6 +31,8 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) setAllowedAreas(Qt::AllDockWidgetAreas); + CreateWidgets(); + auto& settings = Settings::GetQSettings(); restoreGeometry(settings.value(QStringLiteral("breakpointwidget/geometry")).toByteArray()); @@ -38,8 +40,6 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) // according to Settings setFloating(settings.value(QStringLiteral("breakpointwidget/floating")).toBool()); - CreateWidgets(); - connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) { UpdateButtonsEnabled(); if (state == Core::State::Uninitialized) diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp index eec0b35f1c..18ba3830ec 100644 --- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp @@ -34,6 +34,8 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent) setAllowedAreas(Qt::AllDockWidgetAreas); + CreateWidgets(); + auto& settings = Settings::GetQSettings(); restoreGeometry(settings.value(QStringLiteral("codewidget/geometry")).toByteArray()); @@ -57,7 +59,6 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent) connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &CodeWidget::Update); - CreateWidgets(); ConnectWidgets(); m_code_splitter->restoreState( diff --git a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp index 3abfd73076..7b78595ac9 100644 --- a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp @@ -27,6 +27,8 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent) setAllowedAreas(Qt::AllDockWidgetAreas); + CreateWidgets(); + auto& settings = Settings::GetQSettings(); restoreGeometry(settings.value(QStringLiteral("registerwidget/geometry")).toByteArray()); @@ -34,7 +36,6 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent) // according to Settings setFloating(settings.value(QStringLiteral("registerwidget/floating")).toBool()); - CreateWidgets(); PopulateTable(); ConnectWidgets(); diff --git a/Source/Core/DolphinQt/Debugger/WatchWidget.cpp b/Source/Core/DolphinQt/Debugger/WatchWidget.cpp index a53f7b7ecc..e8bc2b8610 100644 --- a/Source/Core/DolphinQt/Debugger/WatchWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/WatchWidget.cpp @@ -32,6 +32,8 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) setAllowedAreas(Qt::AllDockWidgetAreas); + CreateWidgets(); + auto& settings = Settings::GetQSettings(); restoreGeometry(settings.value(QStringLiteral("watchwidget/geometry")).toByteArray()); @@ -39,7 +41,6 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) // according to Settings setFloating(settings.value(QStringLiteral("watchwidget/floating")).toBool()); - CreateWidgets(); ConnectWidgets(); connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) {