From c8df26554bc5433bff13aaff934d1539226577d7 Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Thu, 29 Jun 2023 22:50:01 -0700 Subject: [PATCH] Fix GC adapter not being detected when you enable controller in settings GCAdapter::UseAdapter() reads s_is_adapter_wanted, which gets initialized by config_guard.~ConfigChangeCallbackGuard(). So we must wait until after destroying the config guard to know whether we have any controllers set to GC Adapter. --- .../Core/DolphinQt/Config/GamecubeControllersWidget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Core/DolphinQt/Config/GamecubeControllersWidget.cpp b/Source/Core/DolphinQt/Config/GamecubeControllersWidget.cpp index c27ab2e99f..38ea1e4e7f 100644 --- a/Source/Core/DolphinQt/Config/GamecubeControllersWidget.cpp +++ b/Source/Core/DolphinQt/Config/GamecubeControllersWidget.cpp @@ -198,12 +198,11 @@ void GamecubeControllersWidget::SaveSettings() static_cast(i)); } } - - if (GCAdapter::UseAdapter()) - GCAdapter::StartScanThread(); - else - GCAdapter::StopScanThread(); } + if (GCAdapter::UseAdapter()) + GCAdapter::StartScanThread(); + else + GCAdapter::StopScanThread(); SConfig::GetInstance().SaveSettings(); }