rhythmbox r6069 - in trunk: . plugins/generic-player



Author: jmatthew
Date: Wed Nov 19 10:46:39 2008
New Revision: 6069
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6069&view=rev

Log:
2008-11-19  Jonathan Matthew  <jonathan d14n org>

	* plugins/generic-player/rb-generic-player-source.c:
	(impl_delete_thyself):
	playlist_deleted_cb modifies the list of playlists, so we need to take
	a copy before we start deleting them all.  Fixes #544614.


Modified:
   trunk/ChangeLog
   trunk/plugins/generic-player/rb-generic-player-source.c

Modified: trunk/plugins/generic-player/rb-generic-player-source.c
==============================================================================
--- trunk/plugins/generic-player/rb-generic-player-source.c	(original)
+++ trunk/plugins/generic-player/rb-generic-player-source.c	Wed Nov 19 10:46:39 2008
@@ -691,14 +691,18 @@
 static void
 impl_delete_thyself (RBSource *source)
 {
+	GList *pl;
 	GList *p;
 	RBGenericPlayerSourcePrivate *priv = GENERIC_PLAYER_SOURCE_GET_PRIVATE (source);
 
-	for (p = priv->playlists; p != NULL; p = p->next) {
+	/* take a copy of the list first, as playlist_deleted_cb modifies priv->playlists */
+	pl = g_list_copy (priv->playlists);
+	for (p = pl; p != NULL; p = p->next) {
 		RBSource *playlist = RB_SOURCE (p->data);
 		rb_source_delete_thyself (playlist);
 	}
 	g_list_free (priv->playlists);
+	g_list_free (pl);
 	priv->playlists = NULL;
 
 	if (priv->import_errors != NULL) {



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