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 749660 - Cannot disconnect signal handlers during a weak ref's notify
Cannot disconnect signal handlers during a weak ref's notify
Status: RESOLVED DUPLICATE of bug 745678
Product: glib
Classification: Platform
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on: 749659
Blocks:
 
 
Reported: 2015-05-21 03:36 UTC by Garrett Regier
Modified: 2015-05-21 14:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Destroy GObject weak refs before signal handlers (2.96 KB, patch)
2015-05-21 03:40 UTC, Garrett Regier
none Details | Review

Description Garrett Regier 2015-05-21 03:36:48 UTC
This causes a warning to be printed. Discovered while writing a test for Builder's EggStateMachine.
Comment 1 Garrett Regier 2015-05-21 03:40:49 UTC
Created attachment 303723 [details] [review]
Destroy GObject weak refs before signal handlers

This was done after fixing Bug 749659 and as such it is required before this.
Comment 2 Christian Hergert 2015-05-21 03:44:55 UTC
Nice.

This is really useful so we don't have to guess about the state of the signal handler. It simplifies our code into "if (handler_id != 0)" since the weak ref will allow us to remove them first.
Comment 3 Allison Karlitskaya (desrt) 2015-05-21 14:42:08 UTC
Again... "where_object_was" is called that for a reason.  This is no longer a valid GObject.

See the docs:

"""

Since the object is already being finalized when the GWeakNotify is called, there's not much you could do with the object, apart from e.g. using its address as hash-index or the like.

"""

*** This bug has been marked as a duplicate of bug 745678 ***