mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 12:58:05 +03: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:
parent
8724daf44e
commit
9db4067957
1 changed files with 5 additions and 2 deletions
|
@ -130,14 +130,17 @@ void Init()
|
||||||
Core::RestoreWiiSettings(Core::RestoreReason::CrashRecovery);
|
Core::RestoreWiiSettings(Core::RestoreReason::CrashRecovery);
|
||||||
|
|
||||||
Config::Init();
|
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());
|
Config::AddLayer(ConfigLoaders::GenerateBaseConfigLoader());
|
||||||
SConfig::Init();
|
SConfig::Init();
|
||||||
Discord::Init();
|
Discord::Init();
|
||||||
Common::Log::LogManager::Init();
|
Common::Log::LogManager::Init();
|
||||||
VideoBackendBase::ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND));
|
VideoBackendBase::ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND));
|
||||||
|
|
||||||
s_config_changed_callback_id = Config::AddConfigChangedCallback(RefreshConfig);
|
|
||||||
RefreshConfig();
|
RefreshConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue