Fix media library reference counting
authorRafaël Carré <funman@videolan.org>
Tue, 1 Apr 2008 20:13:46 +0000 (22:13 +0200)
committerRafaël Carré <funman@videolan.org>
Tue, 1 Apr 2008 20:13:46 +0000 (22:13 +0200)
Please TEST your changes before pushing
At least, READ the code instead of modifying it blindly

src/playlist/engine.c

index daf6d22..18ce3f6 100644 (file)
@@ -398,6 +398,8 @@ check_input:
 
 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++ )
@@ -482,6 +484,7 @@ void playlist_LastLoop( playlist_t *p_playlist )
                                           p_playlist->pp_sds[0]->p_sd->psz_module );
     }
 
+    vlc_gc_incref( p_playlist->p_ml_category->p_input );
     playlist_MLDump( p_playlist );
     /* We don't need the media library anymore */
     ML_Decref( p_playlist->p_ml_category );