From f07ba4ac5b1911d56cf2bb4939cc2a434ac237c0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 27 Jun 2019 01:43:47 +0000 Subject: [PATCH] constraints solver: Avoid critials When the solver is finalized with existing constraints, we end up with criticals when the constraints ref finalize code calls back into the hash table. Avoid that by emptying the hash table beforehand. --- gtk/gtkconstraintsolver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkconstraintsolver.c b/gtk/gtkconstraintsolver.c index 0441ca5e95..22fa0111a4 100644 --- a/gtk/gtkconstraintsolver.c +++ b/gtk/gtkconstraintsolver.c @@ -265,6 +265,7 @@ gtk_constraint_solver_finalize (GObject *gobject) { GtkConstraintSolver *self = GTK_CONSTRAINT_SOLVER (gobject); + g_hash_table_remove_all (self->constraints); g_clear_pointer (&self->constraints, g_hash_table_unref); g_clear_pointer (&self->stay_error_vars, g_ptr_array_unref);