fix input item mem leak
authorRafaël Carré <funman@videolan.org>
Sat, 29 Dec 2007 21:28:44 +0000 (21:28 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 29 Dec 2007 21:28:44 +0000 (21:28 +0000)
src/playlist/loadsave.c

index 97dccca..bdd6b37 100644 (file)
@@ -151,7 +151,7 @@ int playlist_MLLoad( playlist_t *p_playlist )
         goto error;
 
     p_playlist->p_ml_onelevel->p_input =
-    p_playlist->p_ml_category->p_input = p_input; /* We leak that apparently */
+    p_playlist->p_ml_category->p_input = p_input;
 
     vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded,
                         input_item_subitem_added, p_playlist );
@@ -196,6 +196,7 @@ int playlist_MLDump( playlist_t *p_playlist )
     stats_TimerStart( p_playlist, "ML Dump", STATS_TIMER_ML_DUMP );
     playlist_Export( p_playlist, psz_dirname, p_playlist->p_ml_category,
                      "export-xspf" );
+    vlc_gc_decref( p_playlist->p_ml_category->p_input );
     stats_TimerStop( p_playlist, STATS_TIMER_ML_DUMP );
 
     return VLC_SUCCESS;