From 43c16432fc1c02392df12aa22401f1f6f782db81 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 22 Oct 2007 20:13:55 +0000 Subject: [PATCH] Plug small one-time leak on Windows. (#488068, Daniel Atallah) 2007-10-22 Tor Lillqvist * glib/gutils.c (_glib_gettext): Plug small one-time leak on Windows. (#488068, Daniel Atallah) svn path=/trunk/; revision=5795 --- ChangeLog | 5 +++++ glib/gutils.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d171296..eb4996f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-22 Tor Lillqvist + + * glib/gutils.c (_glib_gettext): Plug small one-time leak on + Windows. (#488068, Daniel Atallah) + 2007-10-21 Behdad Esfahbod * glib/gdate.c (g_date_strftime): diff --git a/glib/gutils.c b/glib/gutils.c index eb28e50..508f53a 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -3143,7 +3143,7 @@ _g_utils_thread_init (void) * use system codepage as bindtextdomain() doesn't have a UTF-8 * interface. */ -static const gchar * +static gchar * _glib_get_locale_dir (void) { gchar *dir, *cp_dir; @@ -3170,7 +3170,6 @@ _glib_get_locale_dir (void) } #undef GLIB_LOCALE_DIR -#define GLIB_LOCALE_DIR _glib_get_locale_dir () #endif /* G_OS_WIN32 */ @@ -3181,7 +3180,13 @@ _glib_gettext (const gchar *str) if (!_glib_gettext_initialized) { +#ifdef G_OS_WIN32 + gchar *tmp = _glib_get_locale_dir(); + bindtextdomain(GETTEXT_PACKAGE, tmp); + g_free(tmp); +#else bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR); +#endif # ifdef HAVE_BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); # endif -- 2.7.4