NotePlayHandle: fixed crash at playback of subnotes

Commit 08ea133aa2 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 <tobias.doerffel@gmail.com>
This commit is contained in:
Tobias Doerffel
2009-06-18 22:52:41 +02:00
parent cf0a91637b
commit 0d6ba6291b

View File

@@ -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
{