[vlc-devel] commit: playlist: free the items arrays at exit, clean the playing item if it was just stopped ( Rafaël Carré )

git version control git at videolan.org
Tue May 6 13:23:31 CEST 2008


vlc | branch: 0.8.6-bugfix | Rafaël Carré <funman at videolan.org> | Tue May  6 12:02:37 2008 +0200| [daf7b6fe7e23fb207bd346cd717a851461c8c5c1]

playlist: free the items arrays at exit, clean the playing item if it was just stopped

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=daf7b6fe7e23fb207bd346cd717a851461c8c5c1
---

 src/playlist/playlist.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/playlist/playlist.c b/src/playlist/playlist.c
index c55b9b4..0636425 100644
--- a/src/playlist/playlist.c
+++ b/src/playlist/playlist.c
@@ -261,18 +261,26 @@ int playlist_Destroy( playlist_t * p_playlist )
 
     playlist_Clear( p_playlist );
 
+    if( p_playlist->status.p_item &&
+        p_playlist->status.p_item->i_flags & PLAYLIST_REMOVE_FLAG )
+    {
+        playlist_ItemDelete( p_playlist->status.p_item );
+        p_playlist->status.p_item = NULL;
+    }
+
     for( i = p_playlist->i_views - 1; i >= 0 ; i-- )
     {
         playlist_view_t *p_view = p_playlist->pp_views[i];
-        if( p_view->psz_name )
-            free( p_view->psz_name );
+        free( p_view->psz_name );
         playlist_ItemDelete( p_view->p_root );
         REMOVE_ELEM( p_playlist->pp_views, p_playlist->i_views, i );
         free( p_view );
     }
 
-    if( p_playlist->p_stats )
-        free( p_playlist->p_stats );
+    free( p_playlist->p_stats );
+
+    free( p_playlist->pp_all_items );
+    free( p_playlist->pp_views );
 
     vlc_mutex_destroy( &p_playlist->gc_lock );
     vlc_object_destroy( p_playlist->p_preparse );




More information about the vlc-devel mailing list