After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774790 - GtkTextHandle does not unref all GtkAdjustment it references
GtkTextHandle does not unref all GtkAdjustment it references
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-11-21 15:44 UTC by Massimo
Modified: 2016-11-23 18:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Massimo 2016-11-21 15:44:45 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:

https://git.gnome.org/browse/gtk+/tree/gtk/gtktexthandle.c?h=gtk-3-22#n457

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
added there.

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.