[gnome-shell] st/texture-cache: Make key g_autofree



commit e73204b9fae1970fc1a4683f6f609edce69af275
Author: Ivan Molodetskikh <yalterz gmail com>
Date:   Tue Jan 5 16:40:15 2021 +0300

    st/texture-cache: Make key g_autofree
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1558>

 src/st/st-texture-cache.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index ac4db8f86c..744acd509f 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -971,7 +971,7 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
   ClutterActor *actor;
   gint scale;
   char *gicon_string;
-  char *key;
+  g_autofree char *key = NULL;
   float actor_size;
   GtkIconTheme *theme;
   GtkIconInfo *info;
@@ -1050,7 +1050,6 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
     {
       /* If there's an outstanding request, we've just added ourselves to it */
       g_object_unref (info);
-      g_free (key);
     }
   else
     {
@@ -1058,7 +1057,7 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
 
       request->cache = cache;
       /* Transfer ownership of key */
-      request->key = key;
+      request->key = g_steal_pointer (&key);
       request->policy = policy;
       request->colors = colors ? st_icon_colors_ref (colors) : NULL;
       request->icon_info = info;


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