mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 16:34:10 +00:00
actor: Avoid queueing redraws during destruction
If an actor or the stage to which it belongs are being destroyed then there is no point in queueing a redraw that will not be seen anyway. Bailing out early also avoids the case in which a redraw is queued during destruction wil cause redraw entries will be added to the Stage, which will take references on it and cause the Stage never to be finalized. http://bugzilla.clutter-project.org/show_bug.cgi?id=2652
This commit is contained in:
parent
835fc2381c
commit
19c986c0c6
@ -5385,17 +5385,13 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
ClutterPaintVolume *volume,
|
ClutterPaintVolume *volume,
|
||||||
ClutterEffect *effect)
|
ClutterEffect *effect)
|
||||||
{
|
{
|
||||||
|
ClutterActorPrivate *priv = self->priv;
|
||||||
ClutterPaintVolume allocation_pv;
|
ClutterPaintVolume allocation_pv;
|
||||||
ClutterActorPrivate *priv;
|
|
||||||
ClutterPaintVolume *pv;
|
ClutterPaintVolume *pv;
|
||||||
gboolean should_free_pv;
|
gboolean should_free_pv;
|
||||||
ClutterActor *stage;
|
ClutterActor *stage;
|
||||||
gboolean was_dirty;
|
gboolean was_dirty;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
|
||||||
|
|
||||||
priv = self->priv;
|
|
||||||
|
|
||||||
/* Here's an outline of the actor queue redraw mechanism:
|
/* Here's an outline of the actor queue redraw mechanism:
|
||||||
*
|
*
|
||||||
* The process starts in one of the following two functions which
|
* The process starts in one of the following two functions which
|
||||||
@ -5465,12 +5461,20 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
* paint.
|
* paint.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* ignore queueing a redraw for actors being destroyed */
|
||||||
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
|
||||||
|
return;
|
||||||
|
|
||||||
stage = _clutter_actor_get_stage_internal (self);
|
stage = _clutter_actor_get_stage_internal (self);
|
||||||
|
|
||||||
/* Ignore queuing a redraw for actors not descended from a stage */
|
/* Ignore queueing a redraw for actors not descended from a stage */
|
||||||
if (stage == NULL)
|
if (stage == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* ignore queueing a redraw on stages that are being destroyed */
|
||||||
|
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
|
||||||
|
return;
|
||||||
|
|
||||||
if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION)
|
if (flags & CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION)
|
||||||
{
|
{
|
||||||
ClutterActorBox allocation_clip;
|
ClutterActorBox allocation_clip;
|
||||||
@ -5581,6 +5585,8 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|||||||
void
|
void
|
||||||
clutter_actor_queue_redraw (ClutterActor *self)
|
clutter_actor_queue_redraw (ClutterActor *self)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
_clutter_actor_queue_redraw_full (self,
|
_clutter_actor_queue_redraw_full (self,
|
||||||
0, /* flags */
|
0, /* flags */
|
||||||
NULL, /* clip volume */
|
NULL, /* clip volume */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user