changeset 2142:959722e6e277 trunk

[svn] - clear and free a playlist passed to playlist_remove_playlist
author giacomo
date Sat, 16 Dec 2006 05:41:27 -0800
parents 06a86fdd4fb7
children f7eeb54c6467
files ChangeLog audacious/playlist.c audacious/playlist.h
diffstat 3 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Dec 16 05:18:19 2006 -0800
+++ b/ChangeLog	Sat Dec 16 05:41:27 2006 -0800
@@ -1,3 +1,12 @@
+2006-12-16 13:18:19 +0000  Giacomo Lozito <james@develia.org>
+  revision [3287]
+  added playlist_free and ensure that each created playlist is freed in mainwin_quit_cb; the list of playlists is freed there as well
+  trunk/audacious/mainwin.c  |   16 ++++++++++++++--
+  trunk/audacious/playlist.c |   16 +++++++++++++++-
+  trunk/audacious/playlist.h |    2 +-
+  3 files changed, 30 insertions(+), 4 deletions(-)
+
+
 2006-12-16 12:49:16 +0000  Giacomo Lozito <james@develia.org>
   revision [3285]
   - made playlistwin_update_list depend on passed Playlist* instead of blindly using playlist_get_active(); this solves many locking issues with multiple playlists, but SHOULD be reviewed in every place playlistwin_update_list is used; added a playlist_new_from_selected() call too
--- a/audacious/playlist.c	Sat Dec 16 05:18:19 2006 -0800
+++ b/audacious/playlist.c	Sat Dec 16 05:41:27 2006 -0800
@@ -240,7 +240,10 @@
 void
 playlist_remove_playlist(Playlist *playlist)
 {
+    /* upon removal, a playlist should be cleared and freed */
     playlists = g_list_remove(playlists, playlist);
+    playlist_clear(playlist);
+    playlist_free(playlist);
 
     if (playlists_iter == NULL)
         playlists_iter = playlists;
--- a/audacious/playlist.h	Sat Dec 16 05:18:19 2006 -0800
+++ b/audacious/playlist.h	Sat Dec 16 05:41:27 2006 -0800
@@ -195,6 +195,7 @@
 gboolean playlist_set_current_name(Playlist *playlist, const gchar * filename);
 const gchar *playlist_get_current_name(Playlist *playlist);
 Playlist *playlist_new(void);
+void playlist_free(Playlist *playlist);
 Playlist *playlist_new_from_selected(void);
 
 PlaylistFormat playlist_format_get_from_name(const gchar * filename);