From 939c8f0487377384f0c7ce86cde83eba63a48014 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 14 Apr 2025 02:23:26 -0700 Subject: [PATCH] Qt: Clean up some FrameView technical debt --- src/platform/qt/Window.cpp | 9 +-------- src/platform/qt/Window.h | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 97d77ed84..ad18ab934 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -1754,14 +1754,7 @@ void Window::setupMenu(QMenuBar* menubar) { addGameAction(tr("&Frame inspector..."), "frameWindow", [this]() { if (!m_frameView) { m_frameView = new FrameView(m_controller); - connect(this, &Window::shutdown, this, [this]() { - if (m_frameView) { - m_frameView->close(); - } - }); - connect(m_frameView, &QObject::destroyed, this, [this]() { - m_frameView = nullptr; - }); + connect(this, &Window::shutdown, m_frameView, &QWidget::close); m_frameView->setAttribute(Qt::WA_DeleteOnClose); } m_frameView->show(); diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index cb467f89d..5c73032b5 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -244,7 +244,7 @@ private: std::unique_ptr m_overrideView; std::unique_ptr m_sensorView; std::unique_ptr m_dolphinView; - FrameView* m_frameView = nullptr; + QPointer m_frameView; #ifdef USE_FFMPEG std::unique_ptr m_videoView;