]> git.sesse.net Git - vlc/blobdiff - src/playlist/tree.c
playlist: Never delete the playlist_item directly. We don't know who might need it.
[vlc] / src / playlist / tree.c
index bfe9e1fdb6007b0581912a7f5b0f1389d9a56d66..d79ec49b4a2ed2fc652dba222610049c3e24f003 100644 (file)
@@ -173,24 +173,7 @@ int playlist_NodeDelete( playlist_t *p_playlist, playlist_item_t *p_root,
         if( p_root->p_parent )
             playlist_NodeRemoveItem( p_playlist, p_root, p_root->p_parent );
 
-        /* Check if it is the current node */
-        if( p_playlist->status.p_node == p_root )
-        {
-            /* Hack we don't call playlist_Control for lock reasons */
-            p_playlist->request.i_status = PLAYLIST_STOPPED;
-            p_playlist->request.b_request = true;
-            p_playlist->request.p_item = NULL;
-            p_playlist->request.p_node = NULL;
-            msg_Info( p_playlist, "stopping playback" );
-            vlc_object_signal_maybe( VLC_OBJECT(p_playlist) );
-
-            PL_DEBUG( "marking %s for further deletion", PLI_NAME( p_root ) );
-            p_root->i_flags |= PLAYLIST_REMOVE_FLAG;
-        }
-        else
-            playlist_ItemDelete( p_root );
-
-
+        playlist_ItemRelease( p_root );
     }
     return VLC_SUCCESS;
 }