[eog/gnome-2-26] Plug a leak in EogImage



commit a10ab24418ce04dbef3d6809105e6572cb07db69
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Sun Apr 26 11:44:43 2009 +0300

    Plug a leak in EogImage
    
    * src/eog-image.c: (eog_image_set_exif_data): Unref the EXIF
    data before setting it, to avoid leaking it in case it is loaded
    more than once.
---
 ChangeLog       |    6 ++++++
 src/eog-image.c |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d762bd4..d877719 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-26  Claudio Saavedra  <csaavedra igalia com>
+
+	* src/eog-image.c: (eog_image_set_exif_data): Unref the EXIF
+	data before setting it, to avoid leaking it in case it is loaded
+	more than once.
+
 2009-04-23  Claudio Saavedra  <csaavedra igalia com>
 
 	* src/eog-thumb-nav.c: (eog_thumb_nav_set_mode): Do not set
diff --git a/src/eog-image.c b/src/eog-image.c
index 840dd0c..f4a846f 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -751,6 +751,9 @@ eog_image_set_exif_data (EogImage *img, EogMetadataReader *md_reader)
 	priv = img->priv;
 
 #ifdef HAVE_EXIF
+	if (priv->exif) {
+		exif_data_unref (priv->exif);
+	}
 	priv->exif = eog_metadata_reader_get_exif_data (md_reader);
 
 	priv->exif_chunk = NULL;



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