gtk+ r21034 - in trunk: . gtk
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21034 - in trunk: . gtk
- Date: Thu, 7 Aug 2008 13:44:22 +0000 (UTC)
Author: mitch
Date: Thu Aug 7 13:44:22 2008
New Revision: 21034
URL: http://svn.gnome.org/viewvc/gtk+?rev=21034&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/gtk/gtkimagemenuitem.c
Modified: trunk/gtk/gtkimagemenuitem.c
==============================================================================
--- trunk/gtk/gtkimagemenuitem.c (original)
+++ trunk/gtk/gtkimagemenuitem.c Thu Aug 7 13:44:22 2008
@@ -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 @@
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 @@
}
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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]