GNOME Bugzilla – Bug 774790
GtkTextHandle does not unref all GtkAdjustment it references
Last modified: 2016-11-23 18:57:23 UTC
To reproduce: run
GOBJECT_DEBUG=objects examples/bp/bloatpad examples/bp/bloatpad.c
click on the textview and press <ctrl>q.
The output includes 2 stale GtkAdjustment objects that are kept
alive by a GtkTextHandle.
The problem is here:
this function references the adjustments when the scrollable is set,
but unref them only if priv->parent_scrollable is != NULL, which instead
can be NULL without executing this function because of the weak pointer
When it does not unreference the adjustments, it does not disconnect the
signal handlers, so in theory if the adjustments survive the GtkScrollable
and the GtkTextHandle, they could emit signals with a stale user_data.