7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

PCM, Fix hanging in m_schema_validator.set_root_schema() on MINGW+UCRT.

For some obscure reason on MINGW, using UCRT compiler version,
m_schema_validator.set_root_schema() hangs in French language.
So, on MINGW+UCRT (specific) switch to a LOCALE_IO before calling set_root_schema().
This commit is contained in:
jean-pierre charras 2024-09-25 15:43:21 +02:00
parent aea42a5cdf
commit 730ff633a8

View File

@ -68,7 +68,7 @@ class THROWING_ERROR_HANDLER : public nlohmann::json_schema::error_handler
}
};
#include <locale_io.h>
PLUGIN_CONTENT_MANAGER::PLUGIN_CONTENT_MANAGER(
std::function<void( int )> aAvailableUpdateCallback ) :
m_dialog( nullptr ),
@ -86,6 +86,12 @@ PLUGIN_CONTENT_MANAGER::PLUGIN_CONTENT_MANAGER(
try
{
// For some obscure reason on MINGW, using UCRT option,
// m_schema_validator.set_root_schema() hangs without switching to locale "C"
#if defined(__MINGW32__) && defined(_UCRT)
LOCALE_IO dummy;
#endif
schema_stream >> schema;
m_schema_validator.set_root_schema( schema );
}