Skip to content
This repository has been archived by the owner on Jan 7, 2018. It is now read-only.

Commit

Permalink
Delete empty tracks from midi reader, fixes a hanging bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
fincs committed Jul 16, 2011
1 parent e94ba53 commit 86220ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/MidiReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ bool MidiReader::Load(const char* filename)
for (int i = 0; i < trkcnt; i ++)
{
tracks.push_back(vector<MidiEvent>());
LoadTrack(f, tracks.back());
vector<MidiEvent>& curtrack = tracks.back();
LoadTrack(f, curtrack);
if (curtrack.size() == 0) tracks.pop_back();
}

return true;
Expand Down

0 comments on commit 86220ad

Please sign in to comment.