소스 검색

ui: fix crash when closing configure window

This crash happens 100% of the time (on Linux at least), you just need
to open the configure window and click OK.

It seems to happen when the tabs are destroyed and once all the tabs are
destroyed, a final signal is sent with `index == -1`. So `debug_tab_tab`
doesn't exist anymore when this happens, so the crash.
Romain Failliot 4 년 전
부모
커밋
427ce8dcef
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/yuzu/configuration/configure_dialog.cpp

+ 5 - 2
src/yuzu/configuration/configure_dialog.cpp

@@ -81,8 +81,11 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
     SetConfiguration();
     PopulateSelectionList();
 
-    connect(ui->tabWidget, &QTabWidget::currentChanged, this,
-            [this]() { debug_tab_tab->SetCurrentIndex(0); });
+    connect(ui->tabWidget, &QTabWidget::currentChanged, this, [this](int index) {
+        if (index != -1) {
+            debug_tab_tab->SetCurrentIndex(0);
+        }
+    });
     connect(ui_tab.get(), &ConfigureUi::LanguageChanged, this, &ConfigureDialog::OnLanguageChanged);
     connect(ui->selectorList, &QListWidget::itemSelectionChanged, this,
             &ConfigureDialog::UpdateVisibleTabs);