[gtk+] Clean up builder parser data after parsing



commit 3c09783005fe74dfa9e15144766a7468281dfc23
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 6 13:45:09 2016 -0400

    Clean up builder parser data after parsing
    
    No need to have these linger around in qdata.

 gtk/gtkwidget.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f8f08ee..ebc8297 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -14020,9 +14020,16 @@ gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
   GSList *atk_relations;
 
   if (g_object_get_qdata (G_OBJECT (buildable), quark_builder_has_default))
-    gtk_widget_grab_default (GTK_WIDGET (buildable));
+    {
+      gtk_widget_grab_default (GTK_WIDGET (buildable));
+      g_object_steal_qdata (G_OBJECT (buildable), quark_builder_has_default);
+    }
+
   if (g_object_get_qdata (G_OBJECT (buildable), quark_builder_has_focus))
-    gtk_widget_grab_focus (GTK_WIDGET (buildable));
+    {
+      gtk_widget_grab_focus (GTK_WIDGET (buildable));
+      g_object_steal_qdata (G_OBJECT (buildable), quark_builder_has_focus);
+    }
 
   atk_relations = g_object_get_qdata (G_OBJECT (buildable),
                                      quark_builder_atk_relations);
@@ -14052,7 +14059,7 @@ gtk_widget_buildable_parser_finished (GtkBuildable *buildable,
       g_object_unref (relation_set);
 
       g_slist_free_full (atk_relations, (GDestroyNotify) free_relation);
-      g_object_set_qdata (G_OBJECT (buildable), quark_builder_atk_relations, NULL);
+      g_object_steal_qdata (G_OBJECT (buildable), quark_builder_atk_relations);
     }
 }
 


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