[mutter/wip/bg-fixes: 5/5] background: don't tank if background is destroyed before it gets a pipeline



commit d66e9e4375da320785e813465aad568feaf5bae3
Author: Ray Strode <rstrode redhat com>
Date:   Mon Mar 25 17:24:01 2013 -0400

    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

 src/compositor/meta-background.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 3380957..2664363 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -704,7 +704,8 @@ static void
 unset_texture (MetaBackground *self)
 {
   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,
                    (GDestroyNotify)
@@ -1069,7 +1070,7 @@ meta_background_load_file_finish (MetaBackground  *self,
                              &key,
                              g_object_ref (pixbuf),
                              (CoglUserDataDestroyCallback)
-                             g_object_unref);
+                             free_pixbuf);
 
   ensure_pipeline (self);
   unset_texture (self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]