Skip to content

listbox: Unparent child after removing from sequence

Georges Basile Stavracas Neto requested to merge gbsneto/issue-1258 into master

Unparenting a GtkListBoxRow can drop its last reference, which will free its memory. Right after unparenting, though, we were accessing the row's iter - which assumes that the row is still alive. This causes a crash when, for example, binding two or more models to the listbox.

Fix that by unparenting after removing the row from the internal GSequence. This is the last place in the function that was trying to access any field from the row.

Fixes #1258 (closed)

Merge request reports