Permalink
Browse files

Delete empty tracks from midi reader, fixes a hanging bug.

  • Loading branch information...
1 parent e94ba53 commit 86220ad1c3a7377241316dd5a1fe56b2e16c850b @fincs committed Jul 16, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 source/MidiReader.cpp
View
4 source/MidiReader.cpp
@@ -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;

0 comments on commit 86220ad

Please sign in to comment.