[vlc-devel] commit: Release children items array ( Rafaël Carré )

git version control git at videolan.org
Tue May 6 14:24:18 CEST 2008


vlc | branch: 0.8.6-bugfix | Rafaël Carré <funman at videolan.org> | Tue May  6 14:24:10 2008 +0200| [b9da1de8597bd18de0f23e59f323bbe609e2f263]

Release children items array

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

 src/playlist/item.c |    7 +++++++
 src/playlist/view.c |    3 ++-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/playlist/item.c b/src/playlist/item.c
index 9dfb882..e9ce3db 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -196,6 +196,13 @@ int playlist_ItemDelete( playlist_item_t *p_item )
         free( p_parent );
     }
 
+    for( ; p_item->i_children > 0 ; )
+    {
+        playlist_item_t *p_child = p_item->pp_children[0];
+        REMOVE_ELEM( p_item->pp_children, p_item->i_children, 0 );
+        playlist_ItemDelete( p_child );
+    }
+
     vlc_input_item_Clean( &p_item->input );
     free( p_item );
 
diff --git a/src/playlist/view.c b/src/playlist/view.c
index e6eb7c7..5ccfd96 100644
--- a/src/playlist/view.c
+++ b/src/playlist/view.c
@@ -2,7 +2,7 @@
  * view.c : Playlist views functions
  *****************************************************************************
  * Copyright (C) 1999-2004 the VideoLAN team
- * $Id$
+ * $Id: e6eb7c756d8f027f9ae5dc601ed90b7b47800014 $
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
  *
@@ -175,6 +175,7 @@ int playlist_ViewUpdate( playlist_t *p_playlist, int i_view)
     if( i_view == VIEW_ALL )
     {
         p_view->p_root->i_children = p_playlist->i_size;
+        free( p_view->p_root->pp_children );
         p_view->p_root->pp_children = p_playlist->pp_items;
     }
 




More information about the vlc-devel mailing list