Explorar o código

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.
Lioncash %!s(int64=7) %!d(string=hai) anos
pai
achega
b47c0c8a80
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/yuzu/configuration/configure_hotkeys.cpp

+ 3 - 3
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;
     }