widget: Don't leak a reference when reordering

When reordering a widget that is alrady under the
same parent, we must not take another reference.
This commit is contained in:
Matthias Clasen 2020-05-09 19:27:05 -04:00
parent c4514e7eb4
commit 0cd0ef2d26

View File

@ -5824,7 +5824,8 @@ gtk_widget_reposition_after (GtkWidget *widget,
/* keep this function in sync with gtk_menu_attach_to_widget()
*/
g_object_ref_sink (widget);
if (priv->parent == NULL)
g_object_ref_sink (widget);
gtk_widget_push_verify_invariants (widget);