gtk+ r21341 - in trunk: . gtk
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21341 - in trunk: . gtk
- Date: Wed, 10 Sep 2008 20:21:59 +0000 (UTC)
Author: bjornl
Date: Wed Sep 10 20:21:59 2008
New Revision: 21341
URL: http://svn.gnome.org/viewvc/gtk+?rev=21341&view=rev
Log:
2008-09-10 BjÃrn Lindqvist <bjourne gmail com>
Bug 551699 â gtk_scrolled_window_destroy() is broken
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_destroy,
gtk_scrolled_window_finalize): Check that the [hv]scrollbar
attributes are not-NULL before destroying and unparenting them.
Modified:
trunk/ChangeLog
trunk/gtk/gtkscrolledwindow.c
Modified: trunk/gtk/gtkscrolledwindow.c
==============================================================================
--- trunk/gtk/gtkscrolledwindow.c (original)
+++ trunk/gtk/gtkscrolledwindow.c Wed Sep 10 20:21:59 2008
@@ -100,7 +100,6 @@
};
static void gtk_scrolled_window_destroy (GtkObject *object);
-static void gtk_scrolled_window_finalize (GObject *object);
static void gtk_scrolled_window_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -192,7 +191,6 @@
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
- gobject_class->finalize = gtk_scrolled_window_finalize;
gobject_class->set_property = gtk_scrolled_window_set_property;
gobject_class->get_property = gtk_scrolled_window_get_property;
@@ -786,26 +784,25 @@
{
GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (object);
- gtk_widget_unparent (scrolled_window->hscrollbar);
- gtk_widget_unparent (scrolled_window->vscrollbar);
- gtk_widget_destroy (scrolled_window->hscrollbar);
- gtk_widget_destroy (scrolled_window->vscrollbar);
+ if (scrolled_window->hscrollbar)
+ {
+ gtk_widget_unparent (scrolled_window->hscrollbar);
+ gtk_widget_destroy (scrolled_window->hscrollbar);
+ g_object_unref (scrolled_window->hscrollbar);
+ scrolled_window->hscrollbar = NULL;
+ }
+ if (scrolled_window->vscrollbar)
+ {
+ gtk_widget_unparent (scrolled_window->vscrollbar);
+ gtk_widget_destroy (scrolled_window->vscrollbar);
+ g_object_unref (scrolled_window->vscrollbar);
+ scrolled_window->vscrollbar = NULL;
+ }
GTK_OBJECT_CLASS (gtk_scrolled_window_parent_class)->destroy (object);
}
static void
-gtk_scrolled_window_finalize (GObject *object)
-{
- GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (object);
-
- g_object_unref (scrolled_window->hscrollbar);
- g_object_unref (scrolled_window->vscrollbar);
-
- G_OBJECT_CLASS (gtk_scrolled_window_parent_class)->finalize (object);
-}
-
-static void
gtk_scrolled_window_set_property (GObject *object,
guint prop_id,
const GValue *value,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]