[rhythmbox] Fix memleak with latest libjuicer changes



commit e92b552894ed5560bc75fbd6ac99be96831d1c80
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 7 23:16:00 2009 +0100

    Fix memleak with latest libjuicer changes
    
    See bug #581775, the albums list is owned by the signal callback.
---
 plugins/audiocd/rb-audiocd-source.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/plugins/audiocd/rb-audiocd-source.c b/plugins/audiocd/rb-audiocd-source.c
index b0f214c..c8456db 100644
--- a/plugins/audiocd/rb-audiocd-source.c
+++ b/plugins/audiocd/rb-audiocd-source.c
@@ -598,6 +598,11 @@ metadata_cb (SjMetadataGetter *metadata,
 		cd_track = g_list_next (cd_track);
 	}
 
+	/* And free the albums list, as it belongs to us, not
+	 * the metadata getter */
+	g_list_foreach (albums, (GFunc)album_details_free, NULL);
+	g_list_free (albums);
+
 	g_object_unref (metadata);
 	priv->metadata = NULL;
 
@@ -611,6 +616,8 @@ metadata_cancelled_cb (SjMetadataGetter *metadata,
 		       gpointer old_source)
 {
 	/* NOTE: the source may have been finalised, and so should NOT be used*/
+	g_list_foreach (albums, (GFunc)album_details_free, NULL);
+	g_list_free (albums);
 	g_object_unref (metadata);
 }
 #endif



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