diff options
author | Michael Natterer <mitch@imendio.com> | 2008-08-07 13:44:22 +0000 |
---|---|---|
committer | Michael Natterer <mitch@src.gnome.org> | 2008-08-07 13:44:22 +0000 |
commit | 141af56c43c63d858203d52d4bddcfb5e63e2704 (patch) | |
tree | ce991c7abdb3464cc0dd7ce61474a0a3f017fbdc /gtk | |
parent | 0acb5856e9a2accc9ded28016d12c66ca0ed7171 (diff) | |
download | gtk+-141af56c43c63d858203d52d4bddcfb5e63e2704.tar.gz |
Bug 546756 – gnome-panel crashed with SIGSEGV in
2008-08-07 Michael Natterer <mitch@imendio.com>
Bug 546756 – gnome-panel crashed with SIGSEGV in
g_type_check_instance_cast()
* gtk/gtkimagemenuitem.c: add GtkObject::destroy() implementation
and remove the image now that it's an internal child and isn't
destroyed by gtk_container_destroy() any longer. Thanks to tml for
helping bisecting this down.
svn path=/trunk/; revision=21034
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkimagemenuitem.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c index 6c8e4ed547..d0f296284f 100644 --- a/gtk/gtkimagemenuitem.c +++ b/gtk/gtkimagemenuitem.c @@ -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_image_menu_item, GTK_TYPE_MENU_ITEM) 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_item) } 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) { |