[empathy] Fix memleak in avatar_chooser_maybe_convert_and_scale. Unref the scaled buffer



commit 5a3ccbe8b14853cf20707c2360c91f7c5289dae5
Author: Lars-Peter Clausen <lars metafoo de>
Date:   Sun Apr 19 19:43:45 2009 +0200

    Fix memleak in avatar_chooser_maybe_convert_and_scale. Unref the scaled buffer
    after it has been saved and is not needed anymore.
---
 libempathy-gtk/empathy-avatar-chooser.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libempathy-gtk/empathy-avatar-chooser.c b/libempathy-gtk/empathy-avatar-chooser.c
index 8c18e8c..02aa689 100644
--- a/libempathy-gtk/empathy-avatar-chooser.c
+++ b/libempathy-gtk/empathy-avatar-chooser.c
@@ -529,6 +529,7 @@ avatar_chooser_maybe_convert_and_scale (EmpathyAvatarChooser *chooser,
 						   &converted_image_size,
 						   new_format_name,
 						   &error, NULL);
+		g_object_unref (pixbuf_scaled);
 
 		if (!saved) {
 			g_free (new_format_name);
@@ -885,7 +886,7 @@ avatar_chooser_update_preview_cb (GtkFileChooser       *file_chooser,
 						  GTK_ICON_SIZE_DIALOG);
 		}
 
-        g_free (filename);
+		g_free (filename);
 	}
 
 	gtk_file_chooser_set_preview_widget_active (file_chooser, TRUE);



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