mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-30 13:20:52 +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))
|
if (MIDI == NULL || 0 != MIDI->Open(Callback, this))
|
||||||
{
|
{
|
||||||
Printf(PRINT_BOLD, "Could not open MIDI out device\n");
|
Printf(PRINT_BOLD, "Could not open MIDI out device\n");
|
||||||
|
if (MIDI != NULL)
|
||||||
|
{
|
||||||
|
delete MIDI;
|
||||||
|
MIDI = NULL;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue