From 33b83516e17a6a34265d036f9e02b272cd1b436a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 26 Jun 2014 13:15:38 +0200 Subject: pango: Don't fail to initialize if LC_CTYPE is not set g_once_init_leave() does not work on NULL, and just returns... and all future calls to g_once_init_enter() will block forever. Happens on Android, so let's just fall back to the C locale if there's nothing else we can do. https://bugzilla.gnome.org/show_bug.cgi?id=732276 --- pango/pango-language.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pango/pango-language.c b/pango/pango-language.c index 15d5fb64..e9c9d1f4 100644 --- a/pango/pango-language.c +++ b/pango/pango-language.c @@ -219,7 +219,14 @@ _pango_get_lc_ctype (void) return g_strdup (ret); #else - return g_strdup (setlocale (LC_CTYPE, NULL)); + { + gchar *lc_ctype = setlocale (LC_CTYPE, NULL); + + if (lc_ctype) + return g_strdup (lc_ctype); + else + return g_strdup ("C"); + } #endif } -- cgit v1.2.1