[gtk+] Plug a few memory leaks



commit 0795237bb2ef7d7381bf5686ddd0d7fee70e9181
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 11 00:42:28 2013 -0500

    Plug a few memory leaks
    
    The accessibles for icon view items were not properly freed
    in all cases.
    https://bugzilla.gnome.org/show_bug.cgi?id=683311

 gtk/a11y/gtkiconviewaccessible.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/a11y/gtkiconviewaccessible.c b/gtk/a11y/gtkiconviewaccessible.c
index cace6c1..db02598 100644
--- a/gtk/a11y/gtkiconviewaccessible.c
+++ b/gtk/a11y/gtkiconviewaccessible.c
@@ -1142,7 +1142,8 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
       gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE);
       g_signal_emit_by_name (atk_obj, "children-changed::remove",
                              index, NULL, NULL);
-      view->priv->items = g_list_remove_link (view->priv->items, deleted_item);
+      view->priv->items = g_list_delete_link (view->priv->items, deleted_item);
+      g_object_unref (info->item);
       g_free (info);
     }
 
@@ -1241,6 +1242,7 @@ gtk_icon_view_accessible_clear_cache (GtkIconViewAccessible *view)
   while (items)
     {
       info = (GtkIconViewItemAccessibleInfo *) items->data;
+      gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE);
       g_object_unref (info->item);
       g_free (items->data);
       items = items->next;


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