From a2b39f782bea8a40471d47ad573596acd383fc7b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Feb 2020 15:59:45 +0100 Subject: [PATCH] Don't call gtk_disable_setlocale() more than once This is useless and just results in GTK warnings. --- src/gtk/app.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 4721bcd85b..a13b90f959 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -356,7 +356,15 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) // Prevent gtk_init_check() from changing the locale automatically for // consistency with the other ports that don't do it. If necessary, // wxApp::SetCLocale() may be explicitly called. - gtk_disable_setlocale(); + // + // Note that this function generates a warning if it's called more than + // once, so avoid them. + static bool s_gtkLocalDisabled = false; + if ( !s_gtkLocalDisabled ) + { + s_gtkLocalDisabled = true; + gtk_disable_setlocale(); + } #ifdef __WXGPE__ init_result = true; // is there a _check() version of this?