[gtk/window-destroy: 64/74] testsuite: Clean up unexpected children



commit 3b77788cad7c3dcf171fe5655610f3fb16b2155d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 9 17:31:18 2020 -0400

    testsuite: Clean up unexpected children
    
    If you call gtk_widget_set_parent on an unsuspecting
    parent widget, it is your reponsibility to clean up
    before the parent gets finalized.

 testsuite/gtk/action.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/gtk/action.c b/testsuite/gtk/action.c
index a07526cbf6..b153d75614 100644
--- a/testsuite/gtk/action.c
+++ b/testsuite/gtk/action.c
@@ -335,9 +335,11 @@ test_overlap2 (void)
   g_assert_cmpint (act1, ==, 0);
   g_assert_cmpint (act2, ==, 1);
 
-  gtk_widget_destroy (text);
   g_object_unref (group1);
   g_object_unref (group2);
+
+  gtk_widget_unparent (child);
+  g_object_unref (g_object_ref_sink (text));
 }
 
 /* Test that gtk_widget_class_query_action


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