[nautilus] window: plug a leak



commit 9531e7cb106f161d8a43da7ca161fac8becd3de6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Feb 21 01:36:00 2011 -0500

    window: plug a leak
    
    Don't leak the GtkSizeGroup after we add widgets to it. Also, move it to
    the pane, where it should belong now.

 src/nautilus-window-pane.c    |    6 +++++-
 src/nautilus-window-private.h |    2 --
 src/nautilus-window.c         |    3 ---
 3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-window-pane.c b/src/nautilus-window-pane.c
index 216bf32..e31e3d8 100644
--- a/src/nautilus-window-pane.c
+++ b/src/nautilus-window-pane.c
@@ -666,7 +666,8 @@ nautilus_window_pane_setup (NautilusWindowPane *pane)
 	pane->widget = gtk_vbox_new (FALSE, 0);
 	window = pane->window;
 
-	header_size_group = window->details->header_size_group;
+	header_size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+	gtk_size_group_set_ignore_hidden (header_size_group, FALSE);
 
 	/* build the toolbar */
 	action_group = nautilus_window_create_toolbar_action_group (window);
@@ -752,6 +753,9 @@ nautilus_window_pane_setup (NautilusWindowPane *pane)
 	 * thus affect the default position of the split view paned.
 	 */
 	gtk_widget_set_size_request (pane->widget, 60, 60);
+
+	/* we can unref the size group now */
+	g_object_unref (header_size_group);
 }
 
 static void
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index 3953e6f..6a4f03f 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -90,8 +90,6 @@ struct NautilusWindowDetails
         GtkWidget *content_paned;
         GtkWidget *content_box;
         NautilusNavigationState *nav_state;
-
-        GtkSizeGroup *header_size_group;
         
         /* Side Pane */
         int side_pane_width;
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 177af13..dbaa697 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -603,9 +603,6 @@ nautilus_window_constructed (GObject *self)
 	g_signal_connect_object (nautilus_signaller_get_current (), "popup_menu_changed",
 			 G_CALLBACK (nautilus_window_load_extension_menus), window, G_CONNECT_SWAPPED);
 
-	window->details->header_size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
-	gtk_size_group_set_ignore_hidden (window->details->header_size_group, FALSE);
-
 	window->details->content_paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
 	gtk_table_attach (GTK_TABLE (window->details->table),
 			  window->details->content_paned,



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