]> git.sesse.net Git - vlc/blobdiff - src/playlist/engine.c
Fix media library's input items reference counting
[vlc] / src / playlist / engine.c
index 5dc8257afe33cb0891a2b4f66c3d697158e35574..0529d75ade3fc20f84b9dbc1c2903c25e9816ea5 100644 (file)
@@ -396,6 +396,15 @@ check_input:
     PL_UNLOCK;
 }
 
+static void ML_Decref( playlist_item_t *p_node )
+{
+    vlc_gc_decref( p_node->p_input );
+
+    int i;
+    if( p_node->i_children > 0 )
+        for( i = 0 ; i < p_node->i_children ; i++ )
+            ML_Decref( p_node->pp_children[i] );
+}
 
 /**
  * Last loop
@@ -476,6 +485,8 @@ void playlist_LastLoop( playlist_t *p_playlist )
     }
 
     playlist_MLDump( p_playlist );
+    /* We don't need the media library anymore */
+    ML_Decref( p_playlist->p_ml_category );
 
     PL_LOCK;
     FOREACH_ARRAY( playlist_item_t *p_del, p_playlist->all_items )