From b47c0c8a801c3e60467ad2a5890a9de0dc33f280 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 9 Apr 2019 19:50:59 -0400 Subject: [PATCH] configure_hotkeys: Avoid dialog memory leak within Configure() Without a parent, this dialog won't have its memory freed when it happens to get destroyed. --- src/yuzu/configuration/configure_hotkeys.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp index 7a09b66b4e..31347ce5a9 100644 --- a/src/yuzu/configuration/configure_hotkeys.cpp +++ b/src/yuzu/configuration/configure_hotkeys.cpp @@ -74,10 +74,10 @@ void ConfigureHotkeys::Configure(QModelIndex index) { auto* const model = ui->hotkey_list->model(); const auto previous_key = model->data(index); - auto* const hotkey_dialog = new SequenceDialog; + SequenceDialog hotkey_dialog; - const int return_code = hotkey_dialog->exec(); - const auto key_sequence = hotkey_dialog->GetSequence(); + const int return_code = hotkey_dialog.exec(); + const auto key_sequence = hotkey_dialog.GetSequence(); if (return_code == QDialog::Rejected || key_sequence.isEmpty()) { return; }