[gnome-shell] Fix reference counting of textures loaded via _load_uri_sync



commit e12587619b54c4cbd3f82469e74d3b1453c2cb9d
Author: Colin Walters <walters verbum org>
Date:   Mon Jul 20 18:19:50 2009 -0400

    Fix reference counting of textures loaded via _load_uri_sync
    
    Avoid double unref, fixes image previews.

 src/shell-texture-cache.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/shell-texture-cache.c b/src/shell-texture-cache.c
index 69b2d77..f8249c0 100644
--- a/src/shell-texture-cache.c
+++ b/src/shell-texture-cache.c
@@ -845,17 +845,17 @@ shell_texture_cache_load_uri_sync (ShellTextureCache *cache,
       texdata = pixbuf_to_cogl_handle (pixbuf);
       g_object_unref (pixbuf);
 
+      clutter_texture_set_cogl_texture (texture, texdata);
+
       if (policy == SHELL_TEXTURE_CACHE_POLICY_FOREVER)
         {
           g_hash_table_insert (cache->priv->keyed_cache, cache_key_dup (&key), texdata);
         }
       else
-        {
-          cogl_handle_unref (texdata);
-        }
+        cogl_handle_unref (texdata);
     }
-
-  clutter_texture_set_cogl_texture (texture, texdata);
+  else
+    clutter_texture_set_cogl_texture (texture, texdata);
 
   return CLUTTER_ACTOR (texture);
 }



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