- 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.
This commit is contained in:
Christoph Oelckers 2019-09-27 20:08:03 +02:00
parent 98a4a77f6b
commit 1cb668e895
2 changed files with 2 additions and 3 deletions

View file

@ -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);
}

View file

@ -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)