Close the SDL_RWops when we're done with it when loading midi audio.

This commit is contained in:
Wayward Heart 2024-05-19 00:03:55 -05:00
parent 891b1fd9f7
commit 181192cb04

View file

@ -631,15 +631,9 @@ struct MidiSource : ALDataSource, MidiReadHandler
throw Exception(Exception::MKXPError, "Reading midi data failed");
}
try
{
readMidi(this, data);
}
catch (const Exception &)
{
SDL_RWclose(&ops);
throw;
}
readMidi(this, data);
synth = shState->midiState().allocateSynth();