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 723771 - gtkwindow: remove delete-event idle function on finalize
gtkwindow: remove delete-event idle function on finalize
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-02-06 15:32 UTC by Claudio Saavedra
Modified: 2014-02-06 16:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkwindow: remove delete-event idle function on finalize (2.07 KB, patch)
2014-02-06 15:32 UTC, Claudio Saavedra
committed Details | Review

Description Claudio Saavedra 2014-02-06 15:32:56 UTC
A busy main loop can prevent the delete-event idle function from being
executed before the window is actually destroyed, causing applications to
crash.
Comment 1 Claudio Saavedra 2014-02-06 15:32:59 UTC
Created attachment 268301 [details] [review]
gtkwindow: remove delete-event idle function on finalize

Heavy duty can prevent this idle function from being called before
the window is destroyed, so make sure that the source is removed
when the window is finalized.
Comment 2 Matthias Clasen 2014-02-06 15:36:33 UTC
I'd prefer to use g_signal_handlers_disconnect_by_func instead of storing the id
Comment 3 Matthias Clasen 2014-02-06 15:37:10 UTC
or alternatively, use g_signal_connect_object
Comment 4 Claudio Saavedra 2014-02-06 15:59:18 UTC
g_source_remove_by_funcs_user_data() only removes one source, so I'm afraid that we might still be left with other sources dangling (say, if a user presses Esc many times in a dialog).

Also note that this is not signal handler but a GSource, so the connect_object() approach won't do it.
Comment 5 Claudio Saavedra 2014-02-06 16:01:44 UTC
Indeed, using g_source_remove_by_funcs_user_data() I still manage to get ephy to crash.
Comment 6 Claudio Saavedra 2014-02-06 16:19:17 UTC
Attachment 268301 [details] pushed as b91859a - gtkwindow: remove delete-event idle function on finalize