diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-07-05 19:21:21 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-07-05 19:21:21 +0000 |
commit | cdc40b11f4d7a3050bda164b2d92afc23616b7f9 (patch) | |
tree | 03cd201e20016a39a60e875e591b1d969d68f425 /hardinfo2/iconcache.c | |
parent | ed4d0b93832732a199f4fb07c70350401f2eaceb (diff) |
Cleanups. Plug most of the memleaks.
Diffstat (limited to 'hardinfo2/iconcache.c')
-rw-r--r-- | hardinfo2/iconcache.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/hardinfo2/iconcache.c b/hardinfo2/iconcache.c index fbd0dd84..49325e39 100644 --- a/hardinfo2/iconcache.c +++ b/hardinfo2/iconcache.c @@ -39,12 +39,13 @@ GdkPixbuf *icon_cache_get_pixbuf(const gchar * file) icon = g_hash_table_lookup(cache, file); if (!icon) { - icon = - gdk_pixbuf_new_from_file(idle_free - (g_build_filename - (params.path_data, "pixmaps", file, - NULL)), NULL); + gchar *path; + + path = g_build_filename(params.path_data, "pixmaps", file, NULL); + icon = gdk_pixbuf_new_from_file(path, NULL); g_hash_table_insert(cache, g_strdup(file), icon); + + g_free(path); } g_object_ref(icon); @@ -71,13 +72,13 @@ GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar * file, gint wid, icon = g_hash_table_lookup(cache, file); if (!icon) { - icon = - gdk_pixbuf_new_from_file_at_size(idle_free - (g_build_filename - (params.path_data, "pixmaps", - file, NULL)), wid, hei, - NULL); + gchar *path; + + path = g_build_filename(params.path_data, "pixmaps", file, NULL); + icon = gdk_pixbuf_new_from_file_at_size(path, wid, hei, NULL); g_hash_table_insert(cache, g_strdup(file), icon); + + g_free(path); } g_object_ref(icon); |