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 1d389ea..207b0f5 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();
     }
 }