]> git.sesse.net Git - vlc/commitdiff
Qt4 playlist: fix crash when deleting nodes and their children
authorJakob Leben <jakob.leben@gmail.com>
Sun, 9 Aug 2009 23:09:27 +0000 (01:09 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 11 Aug 2009 23:07:56 +0000 (01:07 +0200)
This patch fixes the crash when a node is selected together with it's children and then deleted

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/playlist/playlist_model.cpp

index 1d389eac726d700e739b6caa5be4b75ba2624575..207b0f5b5f1a8924085c244e5d36a9e035b5c167 100644 (file)
@@ -738,6 +738,7 @@ void PLModel::doDelete( QModelIndexList selected )
                 recurseDelete( item->children, &selected );
             doDeleteItem( item, &selected );
         }
+        if( i > selected.size() ) i = selected.size();
     }
 }