--- linuxsampler/trunk/src/engines/gig/EngineChannel.cpp 2014/06/10 15:17:01 2613 +++ linuxsampler/trunk/src/engines/gig/EngineChannel.cpp 2014/06/10 17:22:48 2614 @@ -157,10 +157,13 @@ InstrumentIdxName = newInstrument->pInfo->Name; InstrumentStat = 100; - cmd = ChangeInstrument(newInstrument); - if (cmd.pScript) { - // give old instrument script back to instrument resource manager - cmd.pScript->resetAll(); + { + InstrumentChangeCmd< ::gig::DimensionRegion, ::gig::Instrument>& cmd = + ChangeInstrument(newInstrument); + if (cmd.pScript) { + // give old instrument script back to instrument resource manager + cmd.pScript->resetAll(); + } } StatusChanged(true);