- fixed: When MIDI->Open returns failure, the MIDI device needs to be deleted. Otherwise the dead device object can trigger an assert later.

This commit is contained in:
Christoph Oelckers 2016-01-27 10:39:21 +01:00
parent f2666f70dd
commit c3047f448e

View file

@ -344,6 +344,11 @@ void MIDIStreamer::Play(bool looping, int subsong)
if (MIDI == NULL || 0 != MIDI->Open(Callback, this))
{
Printf(PRINT_BOLD, "Could not open MIDI out device\n");
if (MIDI != NULL)
{
delete MIDI;
MIDI = NULL;
}
return;
}