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 723183 - GtkStyleContext: don't use disconnect_by_func()
GtkStyleContext: don't use disconnect_by_func()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-01-28 18:55 UTC by Giovanni Campagna
Modified: 2014-01-29 22:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkStyleContext: don't use disconnect_by_func() (1.88 KB, patch)
2014-01-28 18:56 UTC, Giovanni Campagna
needs-work Details | Review
GtkStyleContext: don't use disconnect_by_func() (2.11 KB, patch)
2014-01-29 20:19 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-01-28 18:55:58 UTC
Fixes a frequent hang in polari (often a minute or more long) that
happens when the GC kicks in.
Comment 1 Giovanni Campagna 2014-01-28 18:56:02 UTC
Created attachment 267435 [details] [review]
GtkStyleContext: don't use disconnect_by_func()

disconnect_by_func() is slow, and this becomes particularly evident
when disposing a number of widgets (and their associated style
context) at once, such as when using a language binding which
uses a GC.
Comment 2 Matthias Clasen 2014-01-29 15:38:28 UTC
seems like an ok workaround in the short term.

proper fixes include:

- add a g_signal_disconnect_first_matched 

- add a way to specify the signal name when disconnecting

both of these should cut down on the number of signal handlers we need to look at when disconnecting
Comment 3 Matthias Clasen 2014-01-29 19:50:57 UTC
Review of attachment 267435 [details] [review]:

::: gtk/gtkstylecontext.c
@@ +688,3 @@
     {
       g_object_ref (cascade);
+      priv->cascade_changed_id = g_signal_connect (cascade,

Looks to me like you are overwriting the id here that you want to use a few lines further down to disconnect ?
Comment 4 Giovanni Campagna 2014-01-29 20:19:29 UTC
Created attachment 267576 [details] [review]
GtkStyleContext: don't use disconnect_by_func()

disconnect_by_func() is slow, and this becomes particularly evident
when disposing a number of widgets (and their associated style
context) at once, such as when using a language binding which
uses a GC.

----

Right, I noticed the same problem after more testing.
This one is a better patch.
Comment 5 Matthias Clasen 2014-01-29 21:57:28 UTC
Review of attachment 267576 [details] [review]:

ok
Comment 6 Giovanni Campagna 2014-01-29 22:12:42 UTC
Attachment 267576 [details] pushed as 8e19b76 - GtkStyleContext: don't use disconnect_by_func()