[gtk+] file button: Don't leak rows



commit c8770b3c63096850c6b3c800b3d870c2d7d1dfef
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 5 11:09:04 2018 -0500

    file button: Don't leak rows
    
    The file chooser button manually manages the memory of
    data in its model, so it needs to explicitly free the
    rows.

 gtk/gtkfilechooserbutton.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index 5168d40..06ebf0f 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -1041,7 +1041,10 @@ gtk_file_chooser_button_finalize (GObject *object)
     g_object_unref (priv->current_folder_while_inactive);
 
   if (priv->model)
-    g_object_unref (priv->model);
+    {
+      model_remove_rows (button, 0, gtk_tree_model_iter_n_children (priv->model, NULL));
+      g_object_unref (priv->model);
+    }
 
   gtk_widget_unparent (priv->button);
   gtk_widget_unparent (priv->combo_box);


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