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 759249 - GObject.disconnect_by_func only disconnect one instance of the signal connection
GObject.disconnect_by_func only disconnect one instance of the signal connection
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-09 14:18 UTC by Thibault Saunier
Modified: 2018-01-10 20:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case showing the issue. (969 bytes, text/plain)
2015-12-09 14:18 UTC, Thibault Saunier
Details

Description Thibault Saunier 2015-12-09 14:18:40 UTC
Created attachment 317038 [details]
Test case showing the issue.

The g_signal_handlers_disconnect_by_func states:

  Disconnects all handlers on an instance that match func and data .

But the attached code sample shows that it only disconnects one handler in pygobject.
Comment 1 Simon Feltman 2016-01-13 07:13:53 UTC
It looks like the Python implementation just finds the first instance and disconnects it [1] & [2]. Unfortunately it also looks like this method might be leaking a reference to the Python function and the C level closure itself since I don't see a call to g_closure_invalidate(), apart from object destruction [3].

[1] https://git.gnome.org/browse/pygobject/tree/gi/pygobject.c?h=3.19.2#n2008
[2] https://git.gnome.org/browse/pygobject/tree/gi/pygtype.c?h=3.19.2#n940
[3] https://git.gnome.org/browse/pygobject/tree/gi/pygobject.c?h=3.19.2#n103
Comment 2 GNOME Infrastructure Team 2018-01-10 20:52:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/106.