[vlc-commits] macosx: work-around a crash when deleting an entire playlist root

Felix Paul Kühne git at videolan.org
Fri Feb 24 18:12:36 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Feb 24 16:55:51 2012 +0100| [58052ea41383cbd3fa362b24318d529f44797004] | committer: Felix Paul Kühne

macosx: work-around a crash when deleting an entire playlist root

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58052ea41383cbd3fa362b24318d529f44797004
---

 modules/gui/macosx/playlist.m |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 9757005..4f78e0b 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -936,6 +936,17 @@
     p_playlist = pl_Get( p_intf );
 
     NSUInteger indexes[i_count];
+    if (i_count == [o_outline_view numberOfRows])
+    {
+#ifndef NDEBUG
+        msg_Dbg( p_intf, "user selected entire list, deleting current playlist root instead of individual items" );
+#endif
+        PL_LOCK;
+        playlist_NodeDelete( p_playlist, [self currentPlaylistRoot], true, false );
+        PL_UNLOCK;
+        [self playlistUpdated];
+        return;
+    }
     [o_selected_indexes getIndexes:indexes maxCount:i_count inIndexRange:nil];
     for (int i = 0; i < i_count; i++)
     {
@@ -958,7 +969,7 @@
                 // if current item is in selected node and is playing then stop playlist
                 playlist_Control(p_playlist, PLAYLIST_STOP, pl_Locked );
 
-            playlist_NodeDelete( p_playlist, p_item, true, false );
+                playlist_NodeDelete( p_playlist, p_item, true, false );
         }
         else
             playlist_DeleteFromInput( p_playlist, p_item->p_input, pl_Locked );



More information about the vlc-commits mailing list