From 87e44aa2410635db7962d6487acab6c72676d057 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 18 Jun 2009 23:05:14 +0200 Subject: [PATCH] Pattern: properly advance iterator when removing notes We must not keep the iterator at the same position when erasing notes from the m_notes array. This usually is not a problem when using QVector but we might switch to QList somewhen later. Signed-off-by: Tobias Doerffel (cherry picked from commit 2d5dfc7b152d79c14e9d2e695c46eb50d84af708) --- src/tracks/pattern.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 1914d19d2..3e0b45044 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -611,7 +611,7 @@ void pattern::changeTimeSignature( void ) if( ( *it )->length() == 0 && ( *it )->pos() >= last_pos ) { delete *it; - m_notes.erase( it ); + it = m_notes.erase( it ); --m_steps; } else