diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index ed70b8bcb..1fb748828 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -172,12 +172,10 @@ void trackContainer::updateAfterTrackAdd( void ) void trackContainer::clearAllTracks( void ) { - for( trackList::iterator it = m_tracks.begin(); - it != m_tracks.end(); ++it ) + while( !m_tracks.isEmpty() ) { - delete *it; + delete m_tracks.first(); } - m_tracks.clear(); }