From: Timm Bäder Date: Tue, 10 Sep 2019 12:51:55 +0000 (+0200) Subject: widget: Inline build_finalize_assertions into only caller X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~861 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8ec1c866e166e1ac7a2774d2282add01ce7d5c4b;p=gtk4.git widget: Inline build_finalize_assertions into only caller --- diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 18dde07f4c..877b387d43 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -7951,35 +7951,6 @@ finalize_assertion_new (GtkWidget *widget, return assertion; } - -static GSList * -build_finalize_assertion_list (GtkWidget *widget) -{ - GType class_type; - GtkWidgetClass *class; - GSList *l, *list = NULL; - - for (class = GTK_WIDGET_GET_CLASS (widget); - GTK_IS_WIDGET_CLASS (class); - class = g_type_class_peek_parent (class)) - { - if (!class->priv->template) - continue; - - class_type = G_OBJECT_CLASS_TYPE (class); - - for (l = class->priv->template->children; l; l = l->next) - { - AutomaticChildClass *child_class = l->data; - FinalizeAssertion *assertion; - - assertion = finalize_assertion_new (widget, class_type, child_class); - list = g_slist_prepend (list, assertion); - } - } - - return list; -} #endif /* G_ENABLE_CONSISTENCY_CHECKS */ static void @@ -8007,7 +7978,28 @@ gtk_widget_real_destroy (GtkWidget *object) * in a full application ecosystem. */ if (g_getenv ("GTK_WIDGET_ASSERT_COMPONENTS") != NULL) - assertions = build_finalize_assertion_list (widget); + { + GType class_type; + + for (class = GTK_WIDGET_GET_CLASS (widget); + GTK_IS_WIDGET_CLASS (class); + class = g_type_class_peek_parent (class)) + { + if (!class->priv->template) + continue; + + class_type = G_OBJECT_CLASS_TYPE (class); + + for (l = class->priv->template->children; l; l = l->next) + { + AutomaticChildClass *child_class = l->data; + FinalizeAssertion *assertion; + + assertion = finalize_assertion_new (widget, class_type, child_class); + assertions = g_slist_prepend (assertions, assertion); + } + } + } #endif /* G_ENABLE_CONSISTENCY_CHECKS */ /* Release references to all automated children */