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 703859 - Crash in StWidget when changing the theme
Crash in StWidget when changing the theme
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: st
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-09 10:41 UTC by Lionel Landwerlin
Modified: 2013-07-10 19:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
st-widget: fix crash with theme context is changed (4.69 KB, patch)
2013-07-09 10:42 UTC, Lionel Landwerlin
none Details | Review
st-theme-node: let paint states take weak ref on theme nodes (4.16 KB, patch)
2013-07-10 15:36 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2013-07-09 10:41:42 UTC
When the St theme is changed, the StThemeContext unrefs all the theme nodes cached in it's internal hash table, then emits a signal to notify all theme nodes that the current theme has changed.
                                                                      
The problem here is that some of the StThemeNodePaintState still have a reference on a theme node that isn't currently applied to any StWidget (ie it's just cached, because it's been used once, but currently isn't). Therefore these StThemeNodes are unreffed and freed before the signal to notify StWidgets is emitted. This results in a crash later on, when StWidgets are propagating the "style-changed" signal down to their children.
Comment 1 Lionel Landwerlin 2013-07-09 10:42:30 UTC
Created attachment 248704 [details] [review]
st-widget: fix crash with theme context is changed
Comment 2 Lionel Landwerlin 2013-07-10 15:36:47 UTC
Created attachment 248844 [details] [review]
st-theme-node: let paint states take weak ref on theme nodes
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-07-10 17:55:56 UTC
Review of attachment 248844 [details] [review]:

OK.
Comment 4 Lionel Landwerlin 2013-07-10 19:29:29 UTC
Pushed to master.