diff --git a/src/citron/main.cpp b/src/citron/main.cpp index b7d90338b..3b5d2a259 100644 --- a/src/citron/main.cpp +++ b/src/citron/main.cpp @@ -445,6 +445,12 @@ GMainWindow::GMainWindow(std::unique_ptr config_, bool has_broken_vulk system->RegisterContentProvider(FileSys::ContentProviderUnionSlot::FrontendManual, provider.get()); system->GetFileSystemController().CreateFactories(*vfs); + system->SetContentProvider(std::make_unique()); + system->RegisterContentProvider(FileSys::ContentProviderUnionSlot::FrontendManual, provider.get()); + + // 1. First, create the factories + system->GetFileSystemController().CreateFactories(*vfs); + autoloader_provider = std::make_unique(); system->RegisterContentProvider(FileSys::ContentProviderUnionSlot::Autoloader, autoloader_provider.get()); @@ -5714,20 +5720,23 @@ void GMainWindow::closeEvent(QCloseEvent* event) { return; } + // This stops mirroring threads before we start saving configs. + if (emu_thread != nullptr) { + ShutdownGame(); + } + + // Now save settings UpdateUISettings(); + config->SaveAllValues(); + game_list->SaveInterfaceLayout(); UISettings::SaveWindowState(); hotkey_registry.SaveHotkeys(); - // Unload controllers early + // Unload controllers controller_dialog->UnloadController(); game_list->UnloadController(); - // Shutdown session if the emu thread is active... - if (emu_thread != nullptr) { - ShutdownGame(); - } - render_window->close(); multiplayer_state->Close(); system->HIDCore().UnloadInputDevices();