diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-10-14 23:59:25 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-10-14 23:59:25 -0400 |
commit | 2eacaf2dd2e2ea23f5a842684b26a5446aece527 (patch) | |
tree | d405bfc560be1e08b516b0e4c842ade01314dd40 /gtk/gtkfontchooserwidget.c | |
parent | ef62a872f5f80e179f328f049ed4c9b023784eec (diff) | |
download | gtk+-2eacaf2dd2e2ea23f5a842684b26a5446aece527.tar.gz |
GtkFontChooserWidget: Plug several memleaks
These were showing up in valgrind.
Diffstat (limited to 'gtk/gtkfontchooserwidget.c')
-rw-r--r-- | gtk/gtkfontchooserwidget.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index 4b403d29fa..cbee925088 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -834,6 +834,7 @@ gtk_font_chooser_widget_cell_data_func (GtkTreeViewColumn *column, pango_font_description_free (font_desc); pango_attr_list_unref (attrs); g_free (text); + g_free (preview_title); } static void @@ -875,6 +876,8 @@ gtk_font_chooser_widget_finalize (GObject *object) if (priv->filter_data_destroy) priv->filter_data_destroy (priv->filter_data); + g_free (priv->preview_text); + G_OBJECT_CLASS (gtk_font_chooser_widget_parent_class)->finalize (object); } @@ -894,13 +897,14 @@ gtk_font_chooser_widget_find_font (GtkFontChooserWidget *fontchooser, GtkFontChooserWidgetPrivate *priv = fontchooser->priv; PangoFontDescription *desc; PangoFontFamily *family; - gboolean valid; + gboolean valid, found; if (pango_font_description_get_family (font_desc) == NULL) return FALSE; + found = FALSE; for (valid = gtk_tree_model_get_iter_first (priv->model, iter); - valid; + valid && !found; valid = gtk_tree_model_iter_next (priv->model, iter)) { gtk_tree_model_get (priv->model, iter, @@ -915,12 +919,12 @@ gtk_font_chooser_widget_find_font (GtkFontChooserWidget *fontchooser, pango_font_description_merge_static (desc, font_desc, FALSE); if (pango_font_description_equal (desc, font_desc)) - break; + found = TRUE; pango_font_description_free (desc); } - return valid; + return found; } static void |