clear all viewable cell renderers so they don't keep pointers to

2004-12-10  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcontainertreeview.c
	(gimp_container_tree_view_clear_items): clear all viewable cell
	renderers so they don't keep pointers to layers/masks which don't
	exist any more. Fixes the additional problem in bug #148852 but
	not the bug itself.
This commit is contained in:
Michael Natterer 2004-12-10 17:56:13 +00:00 committed by Michael Natterer
parent dc3cca1b56
commit 4ee9b210b5
2 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2004-12-10 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontainertreeview.c
(gimp_container_tree_view_clear_items): clear all viewable cell
renderers so they don't keep pointers to layers/masks which don't
exist any more. Fixes the additional problem in bug #148852 but
not the bug itself.
2004-12-09 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpbrushpipe.c (gimp_brush_pipe_select_brush):

View File

@ -694,6 +694,20 @@ gimp_container_tree_view_clear_items (GimpContainerView *view)
gtk_list_store_clear (GTK_LIST_STORE (tree_view->model));
#ifdef __GNUC__
#warning FIXME: remove this hack as soon as bug #149906 is fixed
#endif
/* clear out renderers from all cells so they don't keep refing the
* viewables
*/
if (! gtk_tree_model_iter_n_children (tree_view->model, NULL))
{
GList *list;
for (list = tree_view->renderer_cells; list; list = g_list_next (list))
g_object_set (list->data, "renderer", NULL, NULL);
}
parent_view_iface->clear_items (view);
}