diff --git a/src/sound/music_midistream.cpp b/src/sound/music_midistream.cpp index 579fd7851..dd9e0e0ec 100644 --- a/src/sound/music_midistream.cpp +++ b/src/sound/music_midistream.cpp @@ -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; }