From 49e9aef502547208296eb2f2e212f963950fda63 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 21 Jul 2005 23:37:19 +0000 Subject: [PATCH] Fix a couple of leaks. 2005-07-21 Owen Taylor * gtk/gtkwidget.c (update_pango_context): Fix a couple of leaks. --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkwidget.c | 11 ++++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9196fda558..f1d2304399 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-07-21 Owen Taylor + + * gtk/gtkwidget.c (update_pango_context): Fix a couple of leaks. + 2005-07-21 Christian Rose * configure.in: Added "hy" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9196fda558..f1d2304399 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2005-07-21 Owen Taylor + + * gtk/gtkwidget.c (update_pango_context): Fix a couple of leaks. + 2005-07-21 Christian Rose * configure.in: Added "hy" to ALL_LINGUAS. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9196fda558..f1d2304399 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +2005-07-21 Owen Taylor + + * gtk/gtkwidget.c (update_pango_context): Fix a couple of leaks. + 2005-07-21 Christian Rose * configure.in: Added "hy" to ALL_LINGUAS. diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 60f588fc27..cb763b8509 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -5200,13 +5200,13 @@ update_pango_context (GtkWidget *widget, #ifdef GDK_WINDOWING_X11 GtkSettings *settings; gint hinting; - char *hint_style_str; + gchar *hint_style_str; cairo_hint_style_t hint_style = CAIRO_HINT_STYLE_DEFAULT; gint antialias; cairo_antialias_t antialias_mode = CAIRO_ANTIALIAS_DEFAULT; - char *rgba_str; + gchar *rgba_str; cairo_subpixel_order_t subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT; - int dpi; + gint dpi; cairo_font_options_t *options; #endif @@ -5248,6 +5248,9 @@ update_pango_context (GtkWidget *widget, hint_style = CAIRO_HINT_STYLE_FULL; } + if (hint_style_str) + g_free (hint_style_str); + cairo_font_options_set_hint_style (options, hint_style); if (rgba_str) @@ -5260,6 +5263,8 @@ update_pango_context (GtkWidget *widget, subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB; else if (strcmp (rgba_str, "vbgr") == 0) subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR; + + g_free (rgba_str); } cairo_font_options_set_subpixel_order (options, subpixel_order);