X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fgraphics.c;h=6842000e38c6f7acf3746d8e24692c53b09322a2;hb=393b7a2b777d06754da16ffa5998d3eb9bf128ad;hp=0011a8d56f19c64674f28cb356f50edc5b7163af;hpb=7aabd2ee56aa3de0eafd57e149f632617c8c8ee1;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/graphics.c b/libchimara/graphics.c index 0011a8d..6842000 100644 --- a/libchimara/graphics.c +++ b/libchimara/graphics.c @@ -63,6 +63,7 @@ load_image_from_blorb(giblorb_result_t resource, glui32 image, gint width, gint g_mutex_unlock(glk_data->resource_lock); info->pixbuf = gdk_pixbuf_loader_get_pixbuf(loader); + gdk_pixbuf_ref(info->pixbuf); g_object_unref(loader); return info; @@ -88,6 +89,7 @@ load_image_from_file(const gchar *filename, glui32 image, gint width, gint heigh g_free(info); return NULL; } + gdk_pixbuf_ref(info->pixbuf); return info; } @@ -130,7 +132,6 @@ load_image_in_cache(glui32 image, gint width, gint height) g_free(head); glk_data->image_cache = g_slist_remove_link(glk_data->image_cache, glk_data->image_cache); } - gdk_pixbuf_ref(info->pixbuf); info->width = gdk_pixbuf_get_width(info->pixbuf); info->height = gdk_pixbuf_get_height(info->pixbuf); glk_data->image_cache = g_slist_prepend(glk_data->image_cache, info);