[gthumb] Fixed a crash when resizing many images



commit c9c73e7bc36ee237694a0d87f5ecd742056b31d1
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Aug 26 12:53:20 2010 +0200

    Fixed a crash when resizing many images
    
    Add a reference before unref-ing new_pixbuf because dest and
    new_pixbuf can be the same object.
    
    [bug #627688]

 gthumb/gth-pixbuf-list-task.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/gth-pixbuf-list-task.c b/gthumb/gth-pixbuf-list-task.c
index 5cee903..20d9001 100644
--- a/gthumb/gth-pixbuf-list-task.c
+++ b/gthumb/gth-pixbuf-list-task.c
@@ -268,8 +268,12 @@ pixbuf_task_save_current_pixbuf (GthPixbufListTask *self,
 		return;
 	}
 
+	/* add a reference before unref-ing new_pixbuf because dest and
+	 * new_pixbuf can be the same object. */
+
+	g_object_ref (GTH_PIXBUF_TASK (self->priv->task)->dest);
 	_g_object_unref (self->priv->new_pixbuf);
-	self->priv->new_pixbuf = g_object_ref (GTH_PIXBUF_TASK (self->priv->task)->dest);
+	self->priv->new_pixbuf = GTH_PIXBUF_TASK (self->priv->task)->dest;
 
 	_gdk_pixbuf_save_async (self->priv->new_pixbuf,
 				self->priv->destination_file_data,



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