How to dispose a widget with constraint layout

i have a custom widget with
gtk_widget_class_set_layout_manager_type(widget_class, GTK_TYPE_CONSTRAINT_LAYOUT);
in class_init

i add children and constraints dynamically
how i supposed to dispose the widget?

currently i just unparent each child, but i’m getting g_ref_count_dec: assertion 'rrc < 0' failed error, and that error appears before dispose is invoked
as far as i understand the reason for that are constraints, because the error disappears if i don’t add them

gtk4, c

maybe you don’t properly manage reference count somewhere else in the code, for example, you pass the widgets to somewhere an owned instance is expected, without refing it?

send full listing pls, so that we can see it to help