[gthumb/gthumb-2-14] memory leak in image tool extension's Adjust Colors



commit 59ef625efa30e0c77aa5e31dde621aa424bd9e3e
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 742cfed..2d99631 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]