Commit b048fe57 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

fixed crash when an error occurs while loading an image

parent 03f7f419
......@@ -933,7 +933,7 @@ image_loader_ready_cb (GObject *source_object,
gpointer user_data)
{
GthContactSheetCreator *self = user_data;
GthImage *image;
GthImage *image = NULL;
GdkPixbuf *pixbuf;
int original_width;
int original_height;
......
......@@ -111,7 +111,7 @@ image_loader_ready_cb (GObject *source_object,
{
GthLoadImageInfoTask *self = user_data;
GthImageInfo *image_info;
GthImage *image;
GthImage *image = NULL;
GError *error = NULL;
gth_image_loader_load_finish (GTH_IMAGE_LOADER (source_object),
......@@ -142,7 +142,7 @@ image_loader_ready_cb (GObject *source_object,
else
g_clear_error (&error);
g_object_unref (image);
_g_object_unref (image);
continue_loading_image (self);
}
......
......@@ -2552,7 +2552,7 @@ image_loader_ready_cb (GObject *source_object,
{
GthWebExporter *self = user_data;
ImageData *idata;
GthImage *image;
GthImage *image = NULL;
GdkPixbuf *pixbuf;
if (! gth_image_loader_load_finish (GTH_IMAGE_LOADER (source_object),
......
......@@ -397,7 +397,7 @@ image_loader_ready_cb (GObject *source_object,
LoadRequest *load_request = user_data;
Preloader *preloader = load_request->preloader;
GthImagePreloader *self = preloader->self;
GthImage *image;
GthImage *image = NULL;
int original_width;
int original_height;
GError *error = NULL;
......@@ -415,16 +415,16 @@ image_loader_ready_cb (GObject *source_object,
|| (preloader->token != self->priv->token))
{
load_request_free (load_request);
g_object_unref (image);
if (error != NULL)
g_error_free (error);
_g_object_unref (image);
return;
}
interval = NOT_REQUESTED_INTERVAL;
_g_object_unref (preloader->image);
preloader->image = g_object_ref (image);
preloader->image = _g_object_ref (image);
preloader->original_width = original_width;
preloader->original_height = original_height;
preloader->loaded = success;
......@@ -462,7 +462,7 @@ image_loader_ready_cb (GObject *source_object,
self->priv->load_id = g_timeout_add (interval, load_next, self);
load_request_free (load_request);
g_object_unref (image);
_g_object_unref (image);
}
......
......@@ -124,7 +124,7 @@ image_loader_ready_cb (GObject *source_object,
{
GthOverwriteDialog *self = user_data;
GError *error = NULL;
GthImage *image;
GthImage *image = NULL;
GdkPixbuf *pixbuf;
GtkWidget *viewer;
......
......@@ -428,7 +428,7 @@ cache_image_ready_cb (GObject *source_object,
{
LoadData *load_data = user_data;
GthThumbLoader *self = load_data->thumb_loader;
GthImage *image;
GthImage *image = NULL;
GdkPixbuf *pixbuf;
int width;
int height;
......@@ -735,7 +735,7 @@ original_image_ready_cb (GObject *source_object,
{
LoadData *load_data = user_data;
GthThumbLoader *self = load_data->thumb_loader;
GthImage *image;
GthImage *image = NULL;
GdkPixbuf *pixbuf = NULL;
GError *error = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment