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;