diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index 9574d47c..58328d56 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -911,7 +911,6 @@ static void PickerThreadProcess() } g_currentPickerResultsReady = true; - g_currentPickerVisible = false; } static void ShowPicker(bool folderMode) @@ -926,7 +925,13 @@ static void ShowPicker(bool folderMode) g_currentPickerFolderMode = folderMode; g_currentPickerResultsReady = false; g_currentPickerVisible = true; - g_currentPickerThread = std::make_unique(PickerThreadProcess); + + // Optional single thread mode for testing on systems that do not interact well with the separate thread being used for NFD. + constexpr bool singleThreadMode = false; + if (singleThreadMode) + PickerThreadProcess(); + else + g_currentPickerThread = std::make_unique(PickerThreadProcess); } static void ParseSourcePaths(std::list &paths) @@ -1410,13 +1415,19 @@ void InstallerWizard::Draw() void InstallerWizard::Shutdown() { - // Wait for and erase the thread. + // Wait for and erase the threads. if (g_installerThread != nullptr) { g_installerThread->join(); g_installerThread.reset(); } + if (g_currentPickerThread != nullptr) + { + g_currentPickerThread->join(); + g_currentPickerThread.reset(); + } + // Erase the sources. g_installerSources.game.reset(); g_installerSources.update.reset();