[gthumb] memory leak in image tool extension's Adjust Colors



commit c85991c3bc0677920d6fb49a3dcd26e81eaa4b77
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jan 15 12:21:39 2012 +0100

    memory leak in image tool extension's Adjust Colors
    
    [bug #667931]

 .../file_tools/gth-file-tool-adjust-colors.c       |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/extensions/file_tools/gth-file-tool-adjust-colors.c b/extensions/file_tools/gth-file-tool-adjust-colors.c
index 664b16f..fff831f 100644
--- a/extensions/file_tools/gth-file-tool-adjust-colors.c
+++ b/extensions/file_tools/gth-file-tool-adjust-colors.c
@@ -214,11 +214,10 @@ adjust_colors_after (GthAsyncTask *task,
 		     GError       *error,
 		     gpointer      user_data)
 {
-	AdjustData *adjust_data = user_data;
+	AdjustData              *adjust_data = user_data;
+	GthFileToolAdjustColors *self = adjust_data->self;
 
 	if (error == NULL) {
-		GthFileToolAdjustColors *self = adjust_data->self;
-
 		cairo_surface_destroy (self->priv->destination);
 		self->priv->destination = cairo_surface_reference (adjust_data->destination);
 
@@ -228,6 +227,10 @@ adjust_colors_after (GthAsyncTask *task,
 	}
 
 	pixbuf_cache_free (adjust_data->cache);
+
+	if (self->priv->image_task == GTH_TASK (task))
+		self->priv->image_task = NULL;
+	g_object_unref (task);
 }
 
 



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