[gthumb/gthumb-2-12] do not unref files returned by g_file_icon_get_file



commit 7e77d72bbea51d6bba5ab1869e3dcaae48e2fccc
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Mon Mar 28 19:26:17 2011 +0200

    do not unref files returned by g_file_icon_get_file

 gthumb/gth-icon-cache.c |    7 +++----
 gthumb/gtk-utils.c      |    2 --
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gthumb/gth-icon-cache.c b/gthumb/gth-icon-cache.c
index cf61180..69cbf75 100644
--- a/gthumb/gth-icon-cache.c
+++ b/gthumb/gth-icon-cache.c
@@ -100,13 +100,12 @@ _gth_icon_cache_get_icon_key (GIcon *icon)
 
 		file = g_file_icon_get_file (G_FILE_ICON (icon));
 		if (file != NULL) {
-			char *filename;
+			char *uri;
 
-			filename = g_file_get_path (file);
+			uri = g_file_get_uri (file);
 			key = get_static_string (filename);
 
-			g_free (filename);
-			g_object_unref (file);
+			g_free (uri);
 		}
 	}
 
diff --git a/gthumb/gtk-utils.c b/gthumb/gtk-utils.c
index 82d4f55..8f65e2f 100644
--- a/gthumb/gtk-utils.c
+++ b/gthumb/gtk-utils.c
@@ -713,8 +713,6 @@ get_file_icon_pixbuf (GFileIcon *icon,
 		g_free (filename);
 	}
 
-	g_object_unref (file);
-
 	return pixbuf;
 }
 



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