1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

Fix some memory leaks in gailtreeview.c (now Glade will not crash

anymore when saving a project).

Reference:	http://bugzilla.gnome.org/show_bug.cgi?id=322299
This commit is contained in:
Jean-Yves Lefort 2005-11-25 06:38:42 +00:00
parent 209da06bb1
commit b579a63ab6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=149394
2 changed files with 72 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= gail
PORTVERSION= 1.8.7
PORTREVISION= 1
CATEGORIES= accessibility x11-toolkits
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/1.8

View File

@ -0,0 +1,71 @@
--- gail/gailtreeview.c.orig Tue Nov 22 19:01:37 2005
+++ gail/gailtreeview.c Fri Nov 25 07:12:33 2005
@@ -678,7 +678,9 @@
{
GailTreeView *view = GAIL_TREE_VIEW (object);
- /* remove anyg idle handlers still pending */
+ clear_cached_data (view);
+
+ /* remove any idle handlers still pending */
if (view->idle_garbage_collect_id)
g_source_remove (view->idle_garbage_collect_id);
@@ -692,8 +694,6 @@
if (view->tree_model)
disconnect_model_signals (view);
- clear_cached_data (view);
-
if (view->col_data)
{
GArray *array = view->col_data;
@@ -3295,8 +3295,10 @@
GtkTreeIter new_iter;
gboolean row_expanded;
- if (increment == row)
+ if (increment == row) {
+ gtk_tree_path_free (current_path);
return iter;
+ }
row_expanded = gtk_tree_view_row_expanded (tree_view, current_path);
gtk_tree_path_free (current_path);
@@ -3574,7 +3576,7 @@
g_assert (GAIL_IS_TREE_VIEW (data));
tree_view = (GailTreeView *)data;
- temp_list = tree_view->cell_data;
+ temp_list = g_list_copy (tree_view->cell_data);
tree_view->garbage_collection_pending = FALSE;
tree_view->idle_garbage_collect_id = 0;
@@ -3586,14 +3588,15 @@
if (!cell_info->in_use)
{
/* g_object_unref (cell_info->cell); */
- tree_view->cell_data = g_list_remove_link (tree_view->cell_data,
- temp_list);
+ tree_view->cell_data = g_list_remove (tree_view->cell_data,
+ cell_info);
if (cell_info->cell_row_ref)
gtk_tree_row_reference_free (cell_info->cell_row_ref);
g_free (cell_info);
}
temp_list = temp_list->next;
}
+ g_list_free (temp_list);
return tree_view->garbage_collection_pending;
}
@@ -3989,7 +3992,8 @@
g_assert (GAIL_IS_TREE_VIEW (cell_info->view));
if (!cell_info->view->garbage_collection_pending) {
cell_info->view->garbage_collection_pending = TRUE;
- g_idle_add (garbage_collect_cell_data, cell_info->view);
+ cell_info->view->idle_garbage_collect_id =
+ g_idle_add (garbage_collect_cell_data, cell_info->view);
}
}
}