background: don't tank if background is destroyed before it gets a pipeline

Right now we call unset_texture from MetaBackground's dispose method.

unset_texture assumes there's a pipeline available, but there may not
be if the object was just created.

This commit fixes that incorrect assumption.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
This commit is contained in:
Ray Strode 2013-03-25 17:24:01 -04:00
parent 47cf63bebe
commit 577e5e2e1a

View File

@ -704,7 +704,8 @@ static void
unset_texture (MetaBackground *self) unset_texture (MetaBackground *self)
{ {
MetaBackgroundPrivate *priv = self->priv; MetaBackgroundPrivate *priv = self->priv;
cogl_pipeline_set_layer_texture (priv->pipeline, 0, NULL); if (priv->pipeline != NULL)
cogl_pipeline_set_layer_texture (priv->pipeline, 0, NULL);
g_clear_pointer (&priv->texture, g_clear_pointer (&priv->texture,
(GDestroyNotify) (GDestroyNotify)