From f6590de2cea808bc62a494203c7a8f04ced8aed0 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 17 Jan 2016 22:38:39 -0800 Subject: [PATCH] Qt: Fix even more potential cases of the GBAKeyEditor dangling --- src/platform/qt/GBAKeyEditor.cpp | 4 ++++ src/platform/qt/GBAKeyEditor.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/platform/qt/GBAKeyEditor.cpp b/src/platform/qt/GBAKeyEditor.cpp index cbb74fe85..9519e89d5 100644 --- a/src/platform/qt/GBAKeyEditor.cpp +++ b/src/platform/qt/GBAKeyEditor.cpp @@ -133,6 +133,10 @@ GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString& setAll->setFocus(); } +GBAKeyEditor::~GBAKeyEditor() { + m_controller->releaseFocus(this); +} + void GBAKeyEditor::setAll() { m_currentKey = m_keyOrder.begin(); (*m_currentKey)->setFocus(); diff --git a/src/platform/qt/GBAKeyEditor.h b/src/platform/qt/GBAKeyEditor.h index 8ab83442d..c555e811f 100644 --- a/src/platform/qt/GBAKeyEditor.h +++ b/src/platform/qt/GBAKeyEditor.h @@ -28,6 +28,7 @@ Q_OBJECT public: GBAKeyEditor(InputController* controller, int type, const QString& profile = QString(), QWidget* parent = nullptr); + virtual ~GBAKeyEditor(); public slots: void setAll();