From 1cb668e895e34c7264273ed0333653065052a6e1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 Sep 2019 20:08:03 +0200 Subject: [PATCH] - fixed the GUS MIDI device. The sound font reader may not be deleted because its ownership is transferred to the instrument set. The gus_patchdir variable was not transferred to the config struct. --- src/sound/mididevices/midi_cvars.cpp | 3 ++- src/sound/mididevices/music_timidity_mididevice.cpp | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sound/mididevices/midi_cvars.cpp b/src/sound/mididevices/midi_cvars.cpp index 77570fc3b..4545869d0 100644 --- a/src/sound/mididevices/midi_cvars.cpp +++ b/src/sound/mididevices/midi_cvars.cpp @@ -209,7 +209,7 @@ void Fluid_SetupConfig(FluidConfig *config, const char* patches, bool systemfall if (FileExists(sysdir)) { config->fluid_patchset.push_back(sysdir); - return 1; + return; } // Try again with CT2MGM.SF2 sysdir[filepart + 3] = '2'; @@ -573,6 +573,7 @@ CUSTOM_CVAR(Bool, midi_dmxgus, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) // This CUSTOM_CVAR(String, gus_patchdir, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { + gusConfig.gus_patchdir = self; CheckRestart(MDEV_GUS); } diff --git a/src/sound/mididevices/music_timidity_mididevice.cpp b/src/sound/mididevices/music_timidity_mididevice.cpp index f11153319..bd7888103 100644 --- a/src/sound/mididevices/music_timidity_mididevice.cpp +++ b/src/sound/mididevices/music_timidity_mididevice.cpp @@ -112,7 +112,6 @@ void TimidityMIDIDevice::LoadInstruments(GUSConfig *config) config->instruments.reset(new Timidity::Instruments(psreader)); bool success = config->instruments->LoadDMXGUS(config->gus_memsize) >= 0; - delete psreader; config->dmxgus.clear(); if (success) @@ -130,7 +129,6 @@ void TimidityMIDIDevice::LoadInstruments(GUSConfig *config) config->loadedConfig = config->readerName; config->instruments.reset(new Timidity::Instruments(config->reader)); bool err = config->instruments->LoadConfig() < 0; - delete config->reader; config->reader = nullptr; if (err)