From: Dana Jansens Date: Wed, 9 May 2007 21:26:17 +0000 (+0000) Subject: mem leaks X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=ef4bec071b1b18ea937cef2da6e6ba8aebbe35c6;p=chaz%2Fopenbox mem leaks --- diff --git a/render/font.c b/render/font.c index 85aac3c4..7a6338b0 100644 --- a/render/font.c +++ b/render/font.c @@ -34,22 +34,13 @@ static void measure_font(const RrInstance *inst, RrFont *f) { PangoFontMetrics *metrics; - gchar *locale, *p; - - /* get the default language from the locale - (based on gtk_get_default_language in gtkmain.c) */ - locale = g_strdup(setlocale(LC_CTYPE, NULL)); - if ((p = strchr(locale, '.'))) *p = '\0'; /* strip off the . */ - if ((p = strchr(locale, '@'))) *p = '\0'; /* strip off the @ */ /* measure the ascent and descent */ metrics = pango_context_get_metrics(inst->pango, f->font_desc, - pango_language_from_string(locale)); + pango_language_get_default()); f->ascent = pango_font_metrics_get_ascent(metrics); f->descent = pango_font_metrics_get_descent(metrics); pango_font_metrics_unref(metrics); - - g_free(locale); } RrFont *RrFontOpen(const RrInstance *inst, const gchar *name, gint size, diff --git a/render/theme.c b/render/theme.c index a60fc7b1..756af167 100644 --- a/render/theme.c +++ b/render/theme.c @@ -48,7 +48,7 @@ static xmlNodePtr find_node(xmlNodePtr n, const gchar *names[]); static gboolean find_int(ParseState *ps, xmlNodePtr n, const gchar *names[], gint *integer, gint lower, gint upper); static gboolean find_string(ParseState *ps, xmlNodePtr n, const gchar *names[], - const gchar **string); + gchar **string); static gboolean find_color(ParseState *ps, xmlNodePtr n, const gchar *names[], RrColor **color, gchar *alpha); static gboolean find_point(ParseState *ps, xmlNodePtr n, const gchar *names[], @@ -72,7 +72,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, ParseState ps; xmlNodePtr root; RrJustify winjust, mtitlejust; - const gchar *str; + gchar *str; RrTheme *theme; if (name) { @@ -154,6 +154,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, winjust = RR_JUSTIFY_RIGHT; else if (strcmp(str, "center") == 0) winjust = RR_JUSTIFY_CENTER; + g_free(str); } if (menu_title_font) { @@ -168,6 +169,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name, mtitlejust = RR_JUSTIFY_RIGHT; else if (strcmp(str, "center") == 0) mtitlejust = RR_JUSTIFY_CENTER; + g_free(str); } if (menu_item_font) { @@ -1516,7 +1518,7 @@ static gboolean find_int(ParseState *ps, xmlNodePtr n, const gchar *names[], } static gboolean find_string(ParseState *ps, xmlNodePtr n, const gchar *names[], - const gchar **string) + gchar **string) { if ((n = find_node(n, names))) { *string = parse_string(ps->doc, n);