Qt: Fix even more potential cases of the GBAKeyEditor dangling

This commit is contained in:
Jeffrey Pfau 2016-01-17 22:38:39 -08:00
parent 6bc609b1e0
commit f6590de2ce
2 changed files with 5 additions and 0 deletions

View File

@ -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();

View File

@ -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();