gnome-main-menu r518 - in trunk: . main-menu/src



Author: federico
Date: Tue Oct 28 01:27:59 2008
New Revision: 518
URL: http://svn.gnome.org/viewvc/gnome-main-menu?rev=518&view=rev

Log:
Don't leak the size group used for icons in a tile-table

Signed-off-by: Federico Mena Quintero <federico novell com>

Modified:
   trunk/ChangeLog
   trunk/main-menu/src/tile-table.c

Modified: trunk/main-menu/src/tile-table.c
==============================================================================
--- trunk/main-menu/src/tile-table.c	(original)
+++ trunk/main-menu/src/tile-table.c	Tue Oct 28 01:27:59 2008
@@ -30,6 +30,7 @@
 	BookmarkAgent   *agent;
 
 	GList           *tiles;
+	GtkSizeGroup    *icon_size_group;
 
 	GtkBin         **bins;
 	gint             n_bins;
@@ -119,8 +120,6 @@
 	GtkWidget     *tile;
 	gint           n_tiles;
 
-	GtkSizeGroup *icon_size_group;
-
 	GList *node;
 	gint   i;
 
@@ -144,7 +143,8 @@
 
 	priv->tiles = NULL;
 
-	icon_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+	if (!priv->icon_size_group)
+		priv->icon_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
 	for (node = tiles; node; node = node->next) {
 		tile = GTK_WIDGET (node->data);
@@ -161,7 +161,7 @@
 		priv->tiles = g_list_append (priv->tiles, tile);
 
 		if (IS_NAMEPLATE_TILE (tile))
-			gtk_size_group_add_widget (icon_size_group, NAMEPLATE_TILE (tile)->image);
+			gtk_size_group_add_widget (priv->icon_size_group, NAMEPLATE_TILE (tile)->image);
 	}
 
 	g_list_free (tiles);
@@ -343,6 +343,9 @@
 {
 	TileTablePrivate *priv = PRIVATE (g_obj);
 
+	if (priv->icon_size_group)
+		g_object_unref (priv->icon_size_group);
+
 	g_free (priv->bins);
 
 	G_OBJECT_CLASS (tile_table_parent_class)->finalize (g_obj);



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