Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 86220ad1c3a7377241316dd5a1fe56b2e16c850b 1 parent e94ba53
fincs authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 source/MidiReader.cpp
4 source/MidiReader.cpp
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.