aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/iconcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'hardinfo2/iconcache.c')
-rw-r--r--hardinfo2/iconcache.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hardinfo2/iconcache.c b/hardinfo2/iconcache.c
index 55e98e14..9cb5a035 100644
--- a/hardinfo2/iconcache.c
+++ b/hardinfo2/iconcache.c
@@ -32,6 +32,8 @@ GdkPixbuf *icon_cache_get_pixbuf(const gchar *file)
{
GdkPixbuf *icon;
+ if (!cache) icon_cache_init();
+
icon = g_hash_table_lookup(cache, file);
if (!icon) {
@@ -48,7 +50,7 @@ GdkPixbuf *icon_cache_get_pixbuf(const gchar *file)
GtkWidget *icon_cache_get_image(const gchar *file)
{
GdkPixbuf *icon;
-
+
icon = icon_cache_get_pixbuf(file);
return gtk_image_new_from_pixbuf(icon);
}
@@ -57,6 +59,8 @@ GdkPixbuf *icon_cache_get_pixbuf_at_size(const gchar *file, gint wid, gint hei)
{
GdkPixbuf *icon;
+ if (!cache) icon_cache_init();
+
icon = g_hash_table_lookup(cache, file);
if (!icon) {