Skip to content

Commit

Permalink
meta-background-actor: Fix a warning when dispose is run multiple times
Browse files Browse the repository at this point in the history
When dispose() is called more than once we call meta_background_set_visible_region()
with an invalid top_actor. Make sure the top and bottom actor are NULL after the
first dispose() is called so we can avoid this.
  • Loading branch information
JosephMcc committed May 27, 2017
1 parent 3e72a6a commit f3fed7b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/compositor/meta-background-actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ meta_background_actor_dispose (GObject *object)
priv->background = NULL;
}

if (priv->top_actor != NULL)
priv->top_actor = NULL;

if (priv->bottom_actor != NULL)
priv->bottom_actor = NULL;

G_OBJECT_CLASS (meta_background_actor_parent_class)->dispose (object);
}

Expand Down Expand Up @@ -609,7 +615,8 @@ meta_background_actor_set_visible_region (MetaBackgroundActor *self,

priv = self->priv;

meta_background_set_visible_region (META_BACKGROUND (priv->top_actor), visible_region);
if (priv->top_actor != NULL)
meta_background_set_visible_region (META_BACKGROUND (priv->top_actor), visible_region);
}

/**
Expand Down

0 comments on commit f3fed7b

Please sign in to comment.