Commit 4e75a3b8 authored by Cosimo Cecchi's avatar Cosimo Cecchi

icon-view: clear the icon view when destroying it

This ensures all NautilusFiles are properly unreffed when destroying the
view, and fixes a leak.
parent 199e5adb
......@@ -198,6 +198,7 @@ static void preview_audio (NautilusI
static void update_layout_menus (NautilusIconView *view);
static NautilusFileSortType get_default_sort_order (NautilusFile *file,
gboolean *reversed);
static void nautilus_icon_view_clear (NautilusView *view);
G_DEFINE_TYPE (NautilusIconView, nautilus_icon_view, NAUTILUS_TYPE_VIEW);
......@@ -208,6 +209,8 @@ nautilus_icon_view_destroy (GtkWidget *object)
icon_view = NAUTILUS_ICON_VIEW (object);
nautilus_icon_view_clear (NAUTILUS_VIEW (object));
if (icon_view->details->react_to_icon_change_idle_id != 0) {
g_source_remove (icon_view->details->react_to_icon_change_idle_id);
icon_view->details->react_to_icon_change_idle_id = 0;
......@@ -2544,6 +2547,8 @@ create_icon_container (NautilusIconView *icon_view)
icon_container = nautilus_icon_view_container_new (icon_view);
icon_view->details->icon_container = GTK_WIDGET (icon_container);
g_object_add_weak_pointer (G_OBJECT (icon_container),
(gpointer *) &icon_view->details->icon_container);
gtk_widget_set_can_focus (GTK_WIDGET (icon_container), TRUE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment