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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user