From 4a3cb050edab12cbb314fb9042c0c60ea28db988 Mon Sep 17 00:00:00 2001 From: jp-charras Date: Wed, 24 Aug 2016 14:37:30 +0200 Subject: [PATCH] Fix incorrect management of C locale in vrml plugin --- plugins/3d/vrml/vrml.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/3d/vrml/vrml.cpp b/plugins/3d/vrml/vrml.cpp index 75188a24dc..4cafe02412 100644 --- a/plugins/3d/vrml/vrml.cpp +++ b/plugins/3d/vrml/vrml.cpp @@ -158,15 +158,19 @@ bool CanRender( void ) class LOCALESWITCH { + // Store the user locale name, to restore this locale later, in dtor + std::string m_locale; + public: LOCALESWITCH() { + m_locale = setlocale( LC_NUMERIC, 0 ); setlocale( LC_NUMERIC, "C" ); } ~LOCALESWITCH() { - setlocale( LC_NUMERIC, "" ); + setlocale( LC_NUMERIC, m_locale.c_str() ); } };