diff --git a/ChangeLog b/ChangeLog index c60dc89106..a4b1141f6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-08-03 Michael Natterer + + * app/widgets/gimpcontainergridview.c + (gimp_container_grid_view_item_context): ref/unref the view around + the calls to gimp_container_view_item_selected() and _item_context() + because the former may destroy the view which leads to a crash + when trying the latter. Fixes bug #148955. + 2004-08-03 Michael Natterer * app/core/gimpimage-undo.[ch] (gimp_image_undo_can_compress): diff --git a/app/widgets/gimpcontainergridview.c b/app/widgets/gimpcontainergridview.c index c16a3e7049..950d02250b 100644 --- a/app/widgets/gimpcontainergridview.c +++ b/app/widgets/gimpcontainergridview.c @@ -576,12 +576,19 @@ static void gimp_container_grid_view_item_context (GtkWidget *widget, gpointer data) { + /* ref the view because calling gimp_container_view_item_selected() + * may destroy the widget + */ + g_object_ref (data); + if (gimp_container_view_item_selected (GIMP_CONTAINER_VIEW (data), GIMP_PREVIEW (widget)->viewable)) { gimp_container_view_item_context (GIMP_CONTAINER_VIEW (data), GIMP_PREVIEW (widget)->viewable); } + + g_object_unref (data); } static void