View | Details | Raw Unified | Return to bug 402256
Collapse All | Expand All

(-)a/libslab/ChangeLog (+9 lines)
Lines 1-3 Link Here
1
2008-10-27  Federico Mena Quintero  <federico@novell.com>
2
3
	Fix a possible leak of menus:
4
5
	* tile.c (tile_finalize): Actually destroy the context menu, don't
6
	ref/sink it.
7
	(tile_set_property): Attach the context menu to the tile, don't
8
	just store its pointer.
9
1
2008-09-22  Scott Reeves  <sreeves@novell.com>
10
2008-09-22  Scott Reeves  <sreeves@novell.com>
2
	* document-tile.c:
11
	* document-tile.c:
3
	show remote docs - use gio for tooltip, show icon
12
	show remote docs - use gio for tooltip, show icon
(-)a/libslab/tile.c (-5 / +20 lines)
Lines 209-215 tile_finalize (GObject * g_object) Link Here
209
	if (tile->uri)
209
	if (tile->uri)
210
		g_free (tile->uri);
210
		g_free (tile->uri);
211
	if (tile->context_menu)
211
	if (tile->context_menu)
212
		gtk_object_sink (GTK_OBJECT (tile->context_menu));
212
		gtk_widget_destroy (GTK_WIDGET (tile->context_menu));
213
213
214
	g_object_unref (priv->double_click_detector);
214
	g_object_unref (priv->double_click_detector);
215
215
Lines 240-256 tile_get_property (GObject * g_obj, guint prop_id, GValue * value, GParamSpec * Link Here
240
static void
240
static void
241
tile_set_property (GObject * g_obj, guint prop_id, const GValue * value, GParamSpec * param_spec)
241
tile_set_property (GObject * g_obj, guint prop_id, const GValue * value, GParamSpec * param_spec)
242
{
242
{
243
	Tile *tile;
244
	GtkMenu *menu;
245
243
	if (!IS_TILE (g_obj))
246
	if (!IS_TILE (g_obj))
244
		return;
247
		return;
245
248
249
	tile = TILE (g_obj);
250
246
	switch (prop_id)
251
	switch (prop_id)
247
	{
252
	{
248
	case PROP_TILE_URI:
253
	case PROP_TILE_URI:
249
		TILE (g_obj)->uri = g_strdup (g_value_get_string (value));
254
		tile->uri = g_strdup (g_value_get_string (value));
250
		break;
255
		break;
251
256
252
	case PROP_TILE_CONTEXT_MENU:
257
	case PROP_TILE_CONTEXT_MENU:
253
		TILE (g_obj)->context_menu = g_value_get_object (value);
258
		menu = g_value_get_object (value);
259
260
		if (menu == tile->context_menu)
261
			break;
262
263
		if (tile->context_menu)
264
			gtk_menu_detach (tile->context_menu);
265
266
		tile->context_menu = menu;
267
268
		if (tile->context_menu)
269
			gtk_menu_attach_to_widget (tile->context_menu, GTK_WIDGET (tile), NULL);
270
254
		break;
271
		break;
255
272
256
	default:
273
	default:
257
- 
258
--
259
libslab/ChangeLog        |    4 +++-
274
libslab/ChangeLog        |    4 +++-
260
libslab/nameplate-tile.c |    9 +++++++++
275
libslab/nameplate-tile.c |    9 +++++++++
261
2 files changed, 12 insertions(+), 1 deletions(-)
276
2 files changed, 12 insertions(+), 1 deletions(-)
(-)a/libslab/ChangeLog (-1 / +3 lines)
Lines 1-12 Link Here
1
2008-10-27  Federico Mena Quintero  <federico@novell.com>
1
2008-10-27  Federico Mena Quintero  <federico@novell.com>
2
2
3
	Fix a possible leak of menus:
3
	Fix some memory leaks:
4
4
5
	* tile.c (tile_finalize): Actually destroy the context menu, don't
5
	* tile.c (tile_finalize): Actually destroy the context menu, don't
6
	ref/sink it.
6
	ref/sink it.
7
	(tile_set_property): Attach the context menu to the tile, don't
7
	(tile_set_property): Attach the context menu to the tile, don't
8
	just store its pointer.
8
	just store its pointer.
9
9
10
	* nameplate-tile.c (nameplate_tile_finalize): Free the tooltips.
11
10
2008-09-22  Scott Reeves  <sreeves@novell.com>
12
2008-09-22  Scott Reeves  <sreeves@novell.com>
11
	* document-tile.c:
13
	* document-tile.c:
12
	show remote docs - use gio for tooltip, show icon
14
	show remote docs - use gio for tooltip, show icon
(-)a/libslab/nameplate-tile.c (-2 / +9 lines)
Lines 117-122 nameplate_tile_constructor (GType type, guint n_param, GObjectConstructParam * p Link Here
117
static void
117
static void
118
nameplate_tile_finalize (GObject * g_object)
118
nameplate_tile_finalize (GObject * g_object)
119
{
119
{
120
	NameplateTile *np_tile;
121
	NameplateTilePrivate *priv;
122
123
	np_tile = NAMEPLATE_TILE (g_object);
124
	priv = NAMEPLATE_TILE_GET_PRIVATE (np_tile);
125
126
	if (priv->tooltips)
127
		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
128
120
	(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object);
129
	(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object);
121
}
130
}
122
131
123
- 
124
--
125
libslab/nameplate-tile.c |   14 ++++++++++++--
132
libslab/nameplate-tile.c |   14 ++++++++++++--
126
1 files changed, 12 insertions(+), 2 deletions(-)
133
1 files changed, 12 insertions(+), 2 deletions(-)
(-)a/libslab/nameplate-tile.c (-4 / +12 lines)
Lines 123-130 nameplate_tile_finalize (GObject * g_object) Link Here
123
	np_tile = NAMEPLATE_TILE (g_object);
123
	np_tile = NAMEPLATE_TILE (g_object);
124
	priv = NAMEPLATE_TILE_GET_PRIVATE (np_tile);
124
	priv = NAMEPLATE_TILE_GET_PRIVATE (np_tile);
125
125
126
	if (priv->tooltips)
126
	if (priv->tooltips) {
127
		static int num_destroyed_tooltips;
128
127
		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
129
		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
130
		num_destroyed_tooltips++;
131
		printf ("Destroyed tooltips: %d\n", num_destroyed_tooltips);
132
	}
128
133
129
	(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object);
134
	(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object);
130
}
135
}
Lines 239-246 nameplate_tile_set_property (GObject * g_object, guint prop_id, const GValue * v Link Here
239
244
240
	case PROP_NAMEPLATE_TOOLTIP:
245
	case PROP_NAMEPLATE_TOOLTIP:
241
		if (tooltip) {
246
		if (tooltip) {
242
			if (! priv->tooltips)
247
			if (! priv->tooltips) {
248
				static int num_created_tooltips;
249
243
				priv->tooltips = gtk_tooltips_new ();
250
				priv->tooltips = gtk_tooltips_new ();
251
				num_created_tooltips++;
252
				printf ("Created tooltips: %d\n", num_created_tooltips);
253
			}
244
254
245
			gtk_tooltips_set_tip (priv->tooltips, GTK_WIDGET(this), tooltip, tooltip);
255
			gtk_tooltips_set_tip (priv->tooltips, GTK_WIDGET(this), tooltip, tooltip);
246
			gtk_tooltips_enable(priv->tooltips);
256
			gtk_tooltips_enable(priv->tooltips);
247
- 
248
--
249
libslab/ChangeLog        |    4 ++++
257
libslab/ChangeLog        |    4 ++++
250
libslab/bookmark-agent.c |    6 ++++++
258
libslab/bookmark-agent.c |    6 ++++++
251
2 files changed, 10 insertions(+), 0 deletions(-)
259
2 files changed, 10 insertions(+), 0 deletions(-)
(-)a/libslab/ChangeLog (+4 lines)
Lines 9-14 Link Here
9
9
10
	* nameplate-tile.c (nameplate_tile_finalize): Free the tooltips.
10
	* nameplate-tile.c (nameplate_tile_finalize): Free the tooltips.
11
11
12
	* bookmark-agent.c (create_app_item): Free the URI.
13
	(create_doc_item): Likewise.
14
	(create_dir_item): Likewise.
15
12
2008-09-22  Scott Reeves  <sreeves@novell.com>
16
2008-09-22  Scott Reeves  <sreeves@novell.com>
13
	* document-tile.c:
17
	* document-tile.c:
14
	show remote docs - use gio for tooltip, show icon
18
	show remote docs - use gio for tooltip, show icon
(-)a/libslab/bookmark-agent.c (-2 / +6 lines)
Lines 1063-1068 create_app_item (BookmarkAgent *this, const gchar *uri) Link Here
1063
1063
1064
	if (libslab_strcmp (uri, uri_new))
1064
	if (libslab_strcmp (uri, uri_new))
1065
		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
1065
		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
1066
1067
	g_free (uri_new);
1066
}
1068
}
1067
1069
1068
static void
1070
static void
Lines 1121-1126 create_doc_item (BookmarkAgent *this, const gchar *uri) Link Here
1121
1123
1122
	if (libslab_strcmp (uri, uri_new))
1124
	if (libslab_strcmp (uri, uri_new))
1123
		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
1125
		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
1126
1127
	g_free (uri_new);
1124
}
1128
}
1125
1129
1126
static void
1130
static void
Lines 1204-1209 create_dir_item (BookmarkAgent *this, const gchar *uri) Link Here
1204
	
1208
	
1205
	if (uri_new && libslab_strcmp (uri, uri_new))
1209
	if (uri_new && libslab_strcmp (uri, uri_new))
1206
		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
1210
		g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
1211
1212
	g_free (uri_new);
1207
}
1213
}
1208
1214
1209
static void
1215
static void
1210
- 
1211
--
1212
ChangeLog                  |    8 ++++++++
1216
ChangeLog                  |    8 ++++++++
1213
main-menu/src/tile-table.c |   11 +++++++----
1217
main-menu/src/tile-table.c |   11 +++++++----
1214
2 files changed, 15 insertions(+), 4 deletions(-)
1218
2 files changed, 15 insertions(+), 4 deletions(-)
(-)a/ChangeLog (+8 lines)
Lines 1-3 Link Here
1
2008-10-27  Federico Mena Quintero  <federico@novell.com>
2
3
	* main-menu/src/tile-table.c (TileTablePrivate): Add an
4
	icon_size_group field.
5
	(tile_table_reload): Remember the size group we use for icons,
6
	instead of creating it (and leaking it) every time.
7
	(finalize): Free the icon_size_group.
8
1
2008-09-12  Scott Reeves  <sreeves@novell.com>
9
2008-09-12  Scott Reeves  <sreeves@novell.com>
2
	* configure.in: post release bump to 0.9.12
10
	* configure.in: post release bump to 0.9.12
3
11
(-)a/main-menu/src/tile-table.c (-6 / +7 lines)
Lines 30-35 typedef struct { Link Here
30
	BookmarkAgent   *agent;
30
	BookmarkAgent   *agent;
31
31
32
	GList           *tiles;
32
	GList           *tiles;
33
	GtkSizeGroup    *icon_size_group;
33
34
34
	GtkBin         **bins;
35
	GtkBin         **bins;
35
	gint             n_bins;
36
	gint             n_bins;
Lines 119-126 tile_table_reload (TileTable *this) Link Here
119
	GtkWidget     *tile;
120
	GtkWidget     *tile;
120
	gint           n_tiles;
121
	gint           n_tiles;
121
122
122
	GtkSizeGroup *icon_size_group;
123
124
	GList *node;
123
	GList *node;
125
	gint   i;
124
	gint   i;
126
125
Lines 144-150 tile_table_reload (TileTable *this) Link Here
144
143
145
	priv->tiles = NULL;
144
	priv->tiles = NULL;
146
145
147
	icon_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
146
	if (!priv->icon_size_group)
147
		priv->icon_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
148
148
149
	for (node = tiles; node; node = node->next) {
149
	for (node = tiles; node; node = node->next) {
150
		tile = GTK_WIDGET (node->data);
150
		tile = GTK_WIDGET (node->data);
Lines 161-167 tile_table_reload (TileTable *this) Link Here
161
		priv->tiles = g_list_append (priv->tiles, tile);
161
		priv->tiles = g_list_append (priv->tiles, tile);
162
162
163
		if (IS_NAMEPLATE_TILE (tile))
163
		if (IS_NAMEPLATE_TILE (tile))
164
			gtk_size_group_add_widget (icon_size_group, NAMEPLATE_TILE (tile)->image);
164
			gtk_size_group_add_widget (priv->icon_size_group, NAMEPLATE_TILE (tile)->image);
165
	}
165
	}
166
166
167
	g_list_free (tiles);
167
	g_list_free (tiles);
Lines 343-348 finalize (GObject *g_obj) Link Here
343
{
343
{
344
	TileTablePrivate *priv = PRIVATE (g_obj);
344
	TileTablePrivate *priv = PRIVATE (g_obj);
345
345
346
	if (priv->icon_size_group)
347
		g_object_unref (priv->icon_size_group);
348
346
	g_free (priv->bins);
349
	g_free (priv->bins);
347
350
348
	G_OBJECT_CLASS (tile_table_parent_class)->finalize (g_obj);
351
	G_OBJECT_CLASS (tile_table_parent_class)->finalize (g_obj);
349
- 
350
--
351
ChangeLog                    |    3 +++
352
ChangeLog                    |    3 +++
352
main-menu/src/main-menu-ui.c |    1 +
353
main-menu/src/main-menu-ui.c |    1 +
353
2 files changed, 4 insertions(+), 0 deletions(-)
354
2 files changed, 4 insertions(+), 0 deletions(-)
(-)a/ChangeLog (+3 lines)
Lines 1-5 Link Here
1
2008-10-27  Federico Mena Quintero  <federico@novell.com>
1
2008-10-27  Federico Mena Quintero  <federico@novell.com>
2
2
3
	* main-menu/src/main-menu-ui.c
4
	(setup_recently_used_store_monitor): Free the path.
5
3
	* main-menu/src/tile-table.c (TileTablePrivate): Add an
6
	* main-menu/src/tile-table.c (TileTablePrivate): Add an
4
	icon_size_group field.
7
	icon_size_group field.
5
	(tile_table_reload): Remember the size group we use for icons,
8
	(tile_table_reload): Remember the size group we use for icons,
(-)a/main-menu/src/main-menu-ui.c (-2 / +1 lines)
Lines 1001-1006 setup_recently_used_store_monitor (MainMenuUI *this, gboolean is_startup) Link Here
1001
1001
1002
	path = get_recently_used_store_filename ();
1002
	path = get_recently_used_store_filename ();
1003
	file = g_file_new_for_path (path);
1003
	file = g_file_new_for_path (path);
1004
	g_free (path);
1004
1005
1005
	monitor = g_file_monitor_file (file, 0, NULL, NULL);
1006
	monitor = g_file_monitor_file (file, 0, NULL, NULL);
1006
	if (monitor) {
1007
	if (monitor) {
1007
- 
1008
--
1009
ChangeLog                    |    1 +
1008
ChangeLog                    |    1 +
1010
main-menu/src/main-menu-ui.c |    2 ++
1009
main-menu/src/main-menu-ui.c |    2 ++
1011
2 files changed, 3 insertions(+), 0 deletions(-)
1010
2 files changed, 3 insertions(+), 0 deletions(-)
(-)a/ChangeLog (+1 lines)
Lines 2-7 Link Here
2
2
3
	* main-menu/src/main-menu-ui.c
3
	* main-menu/src/main-menu-ui.c
4
	(setup_recently_used_store_monitor): Free the path.
4
	(setup_recently_used_store_monitor): Free the path.
5
	(setup_recently_used_store_monitor): Unref the file.
5
6
6
	* main-menu/src/tile-table.c (TileTablePrivate): Add an
7
	* main-menu/src/tile-table.c (TileTablePrivate): Add an
7
	icon_size_group field.
8
	icon_size_group field.
(-)a/main-menu/src/main-menu-ui.c (-2 / +2 lines)
Lines 1012-1017 setup_recently_used_store_monitor (MainMenuUI *this, gboolean is_startup) Link Here
1012
				  this);
1012
				  this);
1013
	}
1013
	}
1014
1014
1015
	g_object_unref (file);
1016
1015
	priv->recently_used_store_monitor = monitor;
1017
	priv->recently_used_store_monitor = monitor;
1016
1018
1017
	if (priv->recently_used_timeout_id != 0)
1019
	if (priv->recently_used_timeout_id != 0)
1018
- 
1019
--
1020
libslab/nameplate-tile.c |   10 ++--------
1020
libslab/nameplate-tile.c |   10 ++--------
1021
1 files changed, 2 insertions(+), 8 deletions(-)
1021
1 files changed, 2 insertions(+), 8 deletions(-)
(-)a/libslab/nameplate-tile.c (-9 / +2 lines)
Lines 124-134 nameplate_tile_finalize (GObject * g_object) Link Here
124
	priv = NAMEPLATE_TILE_GET_PRIVATE (np_tile);
124
	priv = NAMEPLATE_TILE_GET_PRIVATE (np_tile);
125
125
126
	if (priv->tooltips) {
126
	if (priv->tooltips) {
127
		static int num_destroyed_tooltips;
128
129
		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
127
		gtk_object_destroy (GTK_OBJECT (priv->tooltips));
130
		num_destroyed_tooltips++;
128
		printf ("del: %p\n", np_tile);
131
		printf ("Destroyed tooltips: %d\n", num_destroyed_tooltips);
132
	}
129
	}
133
130
134
	(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object);
131
	(*G_OBJECT_CLASS (nameplate_tile_parent_class)->finalize) (g_object);
Lines 245-255 nameplate_tile_set_property (GObject * g_object, guint prop_id, const GValue * v Link Here
245
	case PROP_NAMEPLATE_TOOLTIP:
242
	case PROP_NAMEPLATE_TOOLTIP:
246
		if (tooltip) {
243
		if (tooltip) {
247
			if (! priv->tooltips) {
244
			if (! priv->tooltips) {
248
				static int num_created_tooltips;
249
250
				priv->tooltips = gtk_tooltips_new ();
245
				priv->tooltips = gtk_tooltips_new ();
251
				num_created_tooltips++;
246
				printf ("new: %p (%s)\n", this, tooltip);
252
				printf ("Created tooltips: %d\n", num_created_tooltips);
253
			}
247
			}
254
248
255
			gtk_tooltips_set_tip (priv->tooltips, GTK_WIDGET(this), tooltip, tooltip);
249
			gtk_tooltips_set_tip (priv->tooltips, GTK_WIDGET(this), tooltip, tooltip);
256
- 

Return to bug 402256