From 0d6ba6291b62b2d70c44ee45ca6beddf4b0ec54a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 18 Jun 2009 22:52:41 +0200 Subject: [PATCH] NotePlayHandle: fixed crash at playback of subnotes Commit 08ea133aa2d6c4b3f36ff64d57840a429886ffb6 uncovered a flaw in NotePlayHandle::play(...). When iterating over subnotes for each subnote after playing it, we check whether it is finished. If this is true, the according subnote gets erased from the m_subNotes array. However we have to set the subnote iterator to what QList::erase(...) returns instead of keeping it where it was before. This accidentally worked when using QVector as type for NotePlayHandle arrays but caused a crash now that we're using QList. Signed-off-by: Tobias Doerffel --- src/core/note_play_handle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 320ae42a8..ab4cddaae 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -259,7 +259,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer ) if( ( *it )->done() ) { delete *it; - m_subNotes.erase( it ); + it = m_subNotes.erase( it ); } else {