Fix crash when instrument instantiation fails on track creation.
This commit is contained in:
parent
a994fd30bd
commit
3f0130f8ea
@ -2530,12 +2530,15 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output,
|
|||||||
if (instrument) {
|
if (instrument) {
|
||||||
for (RouteList::iterator r = new_routes.begin(); r != new_routes.end(); ++r) {
|
for (RouteList::iterator r = new_routes.begin(); r != new_routes.end(); ++r) {
|
||||||
PluginPtr plugin = instrument->load (*this);
|
PluginPtr plugin = instrument->load (*this);
|
||||||
|
if (!plugin) {
|
||||||
|
warning << "Failed to add Synth Plugin to newly created track." << endmsg;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (pset) {
|
if (pset) {
|
||||||
plugin->load_preset (*pset);
|
plugin->load_preset (*pset);
|
||||||
}
|
}
|
||||||
boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin));
|
boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin));
|
||||||
(*r)->add_processor (p, PreFader);
|
(*r)->add_processor (p, PreFader);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2618,6 +2621,10 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name
|
|||||||
if (instrument) {
|
if (instrument) {
|
||||||
for (RouteList::iterator r = ret.begin(); r != ret.end(); ++r) {
|
for (RouteList::iterator r = ret.begin(); r != ret.end(); ++r) {
|
||||||
PluginPtr plugin = instrument->load (*this);
|
PluginPtr plugin = instrument->load (*this);
|
||||||
|
if (!plugin) {
|
||||||
|
warning << "Failed to add Synth Plugin to newly created track." << endmsg;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (pset) {
|
if (pset) {
|
||||||
plugin->load_preset (*pset);
|
plugin->load_preset (*pset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user