Use a DSO destructor
For the unit tests in testsuite/, the destructor is not called because libgtksourceview-core.la is statically linked to the unit test programs. A solution would be to have the private function _gtksourceview_shutdown() that can be called in unit tests. But the destructor is correctly called in e.g. tests/test-widget or gedit, so it is already useful. At least with gobject-list https://blogs.gnome.org/danni/2011/02/17/ld_preload-gobject-lifetime-debugging-tool/ we can verify that all GtkSource GObjects are finalized. Unfortunately the GtkSourceView destructor runs *after* the "Still Alive:" list that gobject-list prints. But by counting the number of "Finalized object" lines that follow, we can verify that all GObject are finalized.
parent
6c660e84
Please register or sign in to comment