Catch potential runtime error from locale::global

This commit is contained in:
marynate
2021-08-07 12:45:03 +08:00
parent 6c70f2e14f
commit 6908aa4a8a

View File

@@ -189,7 +189,12 @@ void LocalizationService::OnLocalizationChanged()
localeName[currentCulture.Length() + 5] = '8';
localeName[currentCulture.Length() + 6] = 0;
}
std::locale::global(std::locale(localeName));
try
{
std::locale::global(std::locale(localeName));
}
catch (std::runtime_error const&) {}
catch (...) {}
}
#endif