gtk+ r21366 - in branches/gtk-2-12: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21366 - in branches/gtk-2-12: . gtk
- Date: Fri, 12 Sep 2008 04:18:33 +0000 (UTC)
Author: matthiasc
Date: Fri Sep 12 04:18:33 2008
New Revision: 21366
URL: http://svn.gnome.org/viewvc/gtk+?rev=21366&view=rev
Log:
* 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.
Patch by BjÃrn Lindqvist
Modified:
branches/gtk-2-12/ChangeLog
branches/gtk-2-12/gtk/gtkscrolledwindow.c
Modified: branches/gtk-2-12/gtk/gtkscrolledwindow.c
==============================================================================
--- branches/gtk-2-12/gtk/gtkscrolledwindow.c (original)
+++ branches/gtk-2-12/gtk/gtkscrolledwindow.c Fri Sep 12 04:18:33 2008
@@ -101,7 +101,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,
@@ -193,7 +192,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;
@@ -791,26 +789,25 @@
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]