[epiphany] ephy-notebook: fix memory leak



commit 944b0072761ba5d6338ac1044ae8280fd8b142bc
Author: Xan Lopez <xan igalia com>
Date:   Mon Mar 25 22:53:36 2013 +0100

    ephy-notebook: fix memory leak
    
    gtk_style_context_get does return a copy of the requested properties,
    free our pango font description.

 src/ephy-notebook.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index f9a9007..b09ff55 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -531,7 +531,7 @@ tab_label_style_set_cb (GtkWidget *hbox,
        PangoFontMetrics *metrics;
        PangoContext *context;
        GtkStyleContext *style;
-       const PangoFontDescription *font_desc;
+       PangoFontDescription *font_desc;
        GtkWidget *button;
        int char_width, h, w;
 
@@ -542,6 +542,7 @@ tab_label_style_set_cb (GtkWidget *hbox,
        metrics = pango_context_get_metrics (context,
                                             font_desc,
                                             pango_context_get_language (context));
+       pango_font_description_free (font_desc);
        char_width = pango_font_metrics_get_approximate_digit_width (metrics);
        pango_font_metrics_unref (metrics);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]