mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
UICommon: Merge ConfigChangedCallbacks
Use a single lambda as a callback which calls InitCustomPaths and RefreshConfig instead of having separate callbacks for each of them. This fixes the callback for InitCustomPaths not being removed on shutdown; the callback for the lambda (previously for RefreshConfig) is already removed in Shutdown().
This commit is contained in:
@ -130,14 +130,17 @@ void Init()
|
||||
Core::RestoreWiiSettings(Core::RestoreReason::CrashRecovery);
|
||||
|
||||
Config::Init();
|
||||
Config::AddConfigChangedCallback(InitCustomPaths);
|
||||
const auto config_changed_callback = []() {
|
||||
InitCustomPaths();
|
||||
RefreshConfig();
|
||||
};
|
||||
s_config_changed_callback_id = Config::AddConfigChangedCallback(config_changed_callback);
|
||||
Config::AddLayer(ConfigLoaders::GenerateBaseConfigLoader());
|
||||
SConfig::Init();
|
||||
Discord::Init();
|
||||
Common::Log::LogManager::Init();
|
||||
VideoBackendBase::ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND));
|
||||
|
||||
s_config_changed_callback_id = Config::AddConfigChangedCallback(RefreshConfig);
|
||||
RefreshConfig();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user