Remove playlist destructor
authorRafaël Carré <funman@videolan.org>
Wed, 14 May 2008 19:39:21 +0000 (21:39 +0200)
committerRafaël Carré <funman@videolan.org>
Wed, 14 May 2008 19:39:21 +0000 (21:39 +0200)
We need to do stuff BEFORE the playlist is destroyed

src/playlist/engine.c

index b601439..3eae589 100644 (file)
@@ -38,7 +38,6 @@
  * Local prototypes
  *****************************************************************************/
 static void VariablesInit( playlist_t *p_playlist );
-static void playlist_Destructor( vlc_object_t * p_this );
 
 static int RandomCallback( vlc_object_t *p_this, char const *psz_cmd,
                            vlc_value_t oldval, vlc_value_t newval, void *a )
@@ -154,8 +153,6 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
     playlist_MLLoad( p_playlist );
     p_playlist->b_auto_preparse = true;
 
-    vlc_object_set_destructor( p_playlist, playlist_Destructor );
-
     return p_playlist;
 }
 
@@ -168,7 +165,6 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
  */
 void playlist_Destroy( playlist_t *p_playlist )
 {
-    /* XXX: should go in the playlist destructor */
     var_Destroy( p_playlist, "intf-change" );
     var_Destroy( p_playlist, "item-change" );
     var_Destroy( p_playlist, "playlist-current" );
@@ -181,24 +177,12 @@ void playlist_Destroy( playlist_t *p_playlist )
     var_Destroy( p_playlist, "loop" );
     var_Destroy( p_playlist, "activity" );
 
-    vlc_object_release( p_playlist );
-}
-
-static void playlist_Destructor( vlc_object_t * p_this )
-{
-    playlist_t * p_playlist = (playlist_t *)p_this;
-
-    // Kill preparser
     if( p_playlist->p_preparse )
-    {
         vlc_object_release( p_playlist->p_preparse );
-    }
-
-    // Kill meta fetcher
     if( p_playlist->p_fetcher )
-    {
         vlc_object_release( p_playlist->p_fetcher );
-    }
+
+    vlc_object_release( p_playlist );
 }
 
 /* Destroy remaining objects */