st: Guard against spec being invalided during shadow creation
If an actor is pending a relaying when get_allocation_box() is called, the method forces an allocation update. In case of StWidget, this might then result in a style update and a consecutive invalidation of the shadow spec - we will then try to create a shadow specified by random memory, with undefined (though likely fatal) consequences. Guard against this by taking a temporary reference during the function call. https://bugzilla.gnome.org/show_bug.cgi?id=788908
-
This patch seems to fix the crash (or at least I can't reproduce it anymore), but I still see lots of CRITICAL messages in the console like this one:
(gnome-shell:10592): St-CRITICAL **: _st_paint_shadow_with_opacity: assertion 'shadow_spec != NULL' failed
...which seem caused because the
priv->shadow_spec
pointer is still being invalidated (madeNULL
), which makes the following code call_st_paint_shadow_with_opacity()
with an invalid value:static void st_icon_paint (ClutterActor *actor) { StIconPrivate *priv = ST_ICON (actor)->priv; st_widget_paint_background (ST_WIDGET (actor)); if (priv->icon_texture) { if (priv->shadow_pipeline) { ClutterActorBox allocation; float width, height; clutter_actor_get_allocation_box (priv->icon_texture, &allocation); clutter_actor_box_get_size (&allocation, &width, &height); _st_paint_shadow_with_opacity (priv->shadow_spec, priv->shadow_pipeline, &allocation, clutter_actor_get_paint_opacity (priv->icon_texture)); } clutter_actor_paint (priv->icon_texture); } }
Please register or sign in to comment