[vlmc-devel] commit: TracksView: check for track existance before using it when removing item. ( Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Tue Mar 16 23:04:07 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Tue Mar 16 23:03:38 2010 +0100| [d1c5be68654b34056b223fbf63a051af7928cc4e] | committer: Hugo Beauzee-Luyssen 

TracksView: check for track existance before using it when removing item.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=d1c5be68654b34056b223fbf63a051af7928cc4e
---

 src/Gui/timeline/TracksView.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index dc24ac0..8ccf012 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -586,9 +586,13 @@ TracksView::findPosition( AbstractGraphicsMediaItem *item, quint32 track, qint64
 }
 
 void
-TracksView::removeMediaItem( const QUuid &uuid, unsigned int track, MainWorkflow::TrackType trackType )
+TracksView::removeMediaItem( const QUuid &uuid, unsigned int trackId, MainWorkflow::TrackType trackType )
 {
-    QList<QGraphicsItem*> trackItems = getTrack( trackType, track )->childItems();;
+    GraphicsTrack           *track = getTrack( trackType, trackId );
+
+    if ( track == NULL )
+        return ;
+    QList<QGraphicsItem*> trackItems = track->childItems();;
 
     for ( int i = 0; i < trackItems.size(); ++i )
     {



More information about the Vlmc-devel mailing list