[gtk+/gtk-3-22] listbox: Manually unparent placeholder in dispose
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] listbox: Manually unparent placeholder in dispose
- Date: Thu, 11 May 2017 19:02:03 +0000 (UTC)
commit 73179d377145c5ab6bbf8a84d03f752b3359e7d9
Author: Timm Bäder <mail baedert org>
Date: Thu May 11 15:33:13 2017 +0200
listbox: Manually unparent placeholder in dispose
We can't make the placeholder a non-internal child as that breaks
applications that previously relied on foreach() to only return
GtkListBoxRow instances. Instead, unparent the placeholder manually in
dispose.
https://bugzilla.gnome.org/show_bug.cgi?id=782494
gtk/gtklistbox.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index f16e02a..702e342 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -409,6 +409,20 @@ gtk_list_box_finalize (GObject *obj)
}
static void
+gtk_list_box_dispose (GObject *object)
+{
+ GtkListBoxPrivate *priv = BOX_PRIV (object);
+
+ if (priv->placeholder)
+ {
+ gtk_widget_unparent (priv->placeholder);
+ priv->placeholder = NULL;
+ }
+
+ G_OBJECT_CLASS (gtk_list_box_parent_class)->dispose (object);
+}
+
+static void
gtk_list_box_class_init (GtkListBoxClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -421,6 +435,7 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
object_class->get_property = gtk_list_box_get_property;
object_class->set_property = gtk_list_box_set_property;
object_class->finalize = gtk_list_box_finalize;
+ object_class->dispose = gtk_list_box_dispose;
widget_class->enter_notify_event = gtk_list_box_enter_notify_event;
widget_class->leave_notify_event = gtk_list_box_leave_notify_event;
widget_class->motion_notify_event = gtk_list_box_motion_notify_event;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]