mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 09:11:17 +00:00
- 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:
parent
f2666f70dd
commit
c3047f448e
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue