]> git.sesse.net Git - vlc/commitdiff
control/media_list.c: Init and free the flat media list.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 23 Aug 2007 23:44:53 +0000 (23:44 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Thu, 23 Aug 2007 23:44:53 +0000 (23:44 +0000)
src/control/media_list.c

index 47fbd5f185ba3675171efb25a9ecde0e30b7f8d1..461ffd5e71618eac5add9bf9f8c43e654a2687e9 100644 (file)
@@ -170,6 +170,9 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
     p_mlist->p_libvlc_instance = p_inst;
     p_mlist->p_event_manager = libvlc_event_manager_new( p_mlist, p_inst, p_e );
 
+    /* Code for that one should be handled in flat_media_list.c */
+    p_mlist->p_flat_mlist = NULL;
+
     libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
             libvlc_MediaListItemAdded, p_e );
     libvlc_event_manager_register_event_type( p_mlist->p_event_manager,
@@ -213,6 +216,10 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
 
     /* Refcount null, time to free */
 
+    /* Handled in flat_media_list.c */
+    if( p_mlist->p_flat_mlist )
+        libvlc_media_list_release( p_mlist->p_flat_mlist );
+
     libvlc_event_manager_release( p_mlist->p_event_manager );
 
     FOREACH_ARRAY( p_md, p_mlist->items )