fontchooser: Fix objects-finalize test
authorMatthias Clasen <mclasen@redhat.com>
Tue, 14 Jan 2020 20:25:27 +0000 (15:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 Jan 2020 20:25:27 +0000 (15:25 -0500)
commit042537cf0d3fc68527fba890dfa54d16a8538f4e
tree63fe9fd39b1419023072c1280e84fae1161478cc
parentd03f38470ef951d0dd2d5a214060b08697008e31
fontchooser: Fix objects-finalize test

The treeview is evil and keeps reference cycles in the
form of various tree row references. That gets cleaned up
if you explicitly gtk_widget_destroy the treeview. But since
07f2024bfca22331121, the scrolled window no longer destroys
its child, exposing this issue as a reference leak in
the objects-finalize test.

The font chooser widget is affected here because it calls
gtk_tree_view_scroll_to_path from init(), which creates one
of those reference cycles. Work around this in the font
chooser by unsetting the tree view model in dispose, which
clears up this cycle.
gtk/gtkfontchooserwidget.c