[gtk/wip/baedert/for-master] fixed: Implement dispose()



commit 09d428a46f813f2ad4b072987c43d2247af0fbfe
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 3 11:50:06 2019 +0200

    fixed: Implement dispose()

 gtk/gtkbox.c   |  1 -
 gtk/gtkfixed.c | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 81b1fd626d..1e581fa904 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -122,7 +122,6 @@ gtk_box_dispose (GObject *object)
 {
   GtkWidget *child;
 
-
   child = gtk_widget_get_first_child (GTK_WIDGET (object));
   while (child)
     {
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 8049b70e43..984693aaea 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -92,12 +92,33 @@ typedef struct {
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkFixed, gtk_fixed, GTK_TYPE_CONTAINER)
 
+static void
+gtk_fixed_dispose (GObject *object)
+{
+  GtkWidget *child;
+
+  child = gtk_widget_get_first_child (GTK_WIDGET (object));
+  while (child)
+    {
+      GtkWidget *next = gtk_widget_get_next_sibling (child);
+
+      gtk_widget_unparent (child);
+
+      child = next;
+    }
+
+  G_OBJECT_CLASS (gtk_fixed_parent_class)->dispose (object);
+}
+
 static void
 gtk_fixed_class_init (GtkFixedClass *klass)
 {
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
+  object_class->dispose = gtk_fixed_dispose;
+
   container_class->add = gtk_fixed_add;
   container_class->remove = gtk_fixed_remove;
   container_class->forall = gtk_fixed_forall;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]