diff -up gtk+-2.13.6/gtk/gtkimagemenuitem.c.panel-crash gtk+-2.13.6/gtk/gtkimagemenuitem.c --- gtk+-2.13.6/gtk/gtkimagemenuitem.c.panel-crash 2008-08-13 00:53:00.000000000 -0400 +++ gtk+-2.13.6/gtk/gtkimagemenuitem.c 2008-08-13 00:53:10.000000000 -0400 @@ -37,6 +37,7 @@ #include "gtkprivate.h" #include "gtkalias.h" +static void gtk_image_menu_item_destroy (GtkObject *object); static void gtk_image_menu_item_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_image_menu_item_size_allocate (GtkWidget *widget, @@ -73,16 +74,14 @@ G_DEFINE_TYPE (GtkImageMenuItem, gtk_ima static void gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass) { - GObjectClass *gobject_class; - GtkWidgetClass *widget_class; - GtkMenuItemClass *menu_item_class; - GtkContainerClass *container_class; - - gobject_class = (GObjectClass*) klass; - widget_class = (GtkWidgetClass*) klass; - menu_item_class = (GtkMenuItemClass*) klass; - container_class = (GtkContainerClass*) klass; - + GObjectClass *gobject_class = (GObjectClass*) klass; + GtkObjectClass *object_class = (GtkObjectClass*) klass; + GtkWidgetClass *widget_class = (GtkWidgetClass*) klass; + GtkMenuItemClass *menu_item_class = (GtkMenuItemClass*) klass; + GtkContainerClass *container_class = (GtkContainerClass*) klass; + + object_class->destroy = gtk_image_menu_item_destroy; + widget_class->screen_changed = gtk_image_menu_item_screen_changed; widget_class->size_request = gtk_image_menu_item_size_request; widget_class->size_allocate = gtk_image_menu_item_size_allocate; @@ -173,6 +172,18 @@ show_image (GtkImageMenuItem *image_menu } static void +gtk_image_menu_item_destroy (GtkObject *object) +{ + GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (object); + + if (image_menu_item->image) + gtk_container_remove (GTK_CONTAINER (image_menu_item), + image_menu_item->image); + + GTK_OBJECT_CLASS (gtk_image_menu_item_parent_class)->destroy (object); +} + +static void gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item, gint *requisition) { @@ -239,8 +250,8 @@ gtk_image_menu_item_size_request (GtkWid child_width = child_requisition.width; child_height = child_requisition.height; } - - (* GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_request) (widget, requisition); + + GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_request (widget, requisition); /* not done with height since that happens via the * toggle_size_request @@ -270,8 +281,8 @@ gtk_image_menu_item_size_allocate (GtkWi pack_dir = GTK_PACK_DIRECTION_LTR; image_menu_item = GTK_IMAGE_MENU_ITEM (widget); - - (* GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_allocate) (widget, allocation); + + GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_allocate (widget, allocation); if (image_menu_item->image && show_image (image_menu_item)) { @@ -346,11 +357,11 @@ gtk_image_menu_item_forall (GtkContainer gpointer callback_data) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (container); - - (* GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->forall) (container, - include_internals, - callback, - callback_data); + + GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->forall (container, + include_internals, + callback, + callback_data); if (include_internals && image_menu_item->image) (* callback) (image_menu_item->image, callback_data); @@ -555,7 +566,7 @@ gtk_image_menu_item_remove (GtkContainer } else { - (* GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->remove) (container, child); + GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->remove (container, child); } }