NoteData::SetNumTracks: Remove all hold notes that are out of bounds.

Fixes crashes after using "create from copy" in the editor menu.
This commit is contained in:
Glenn Maynard
2004-01-01 22:19:02 +00:00
parent 8e7707f16c
commit 48c8ce5579
+5
View File
@@ -51,6 +51,11 @@ void NoteData::SetNumTracks( int iNewNumTracks )
else
m_TapNotes[t].clear();
}
/* Remove all hold notes that are out of bounds. */
for( int h = m_HoldNotes.size()-1; h >= 0; --h )
if( m_HoldNotes[h].iTrack >= iNewNumTracks )
m_HoldNotes.erase( m_HoldNotes.begin()+h );
}