summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-31 00:35:53 +0100
committerRobin Gareus <robin@gareus.org>2016-10-31 00:35:53 +0100
commit3f0130f8ead44fe6576a33bbe6b3b52156a15248 (patch)
treee9d1c632411401fca1e149d5adb1f79286518649 /libs/ardour/session.cc
parenta994fd30bd2404d4c3328b063c758d205a6b7d7f (diff)
Fix crash when instrument instantiation fails on track creation.
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 5605ac1e6c..51bef1202b 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -2530,12 +2530,15 @@ Session::new_midi_track (const ChanCount& input, const ChanCount& output,
if (instrument) {
for (RouteList::iterator r = new_routes.begin(); r != new_routes.end(); ++r) {
PluginPtr plugin = instrument->load (*this);
+ if (!plugin) {
+ warning << "Failed to add Synth Plugin to newly created track." << endmsg;
+ continue;
+ }
if (pset) {
plugin->load_preset (*pset);
}
boost::shared_ptr<Processor> p (new PluginInsert (*this, plugin));
(*r)->add_processor (p, PreFader);
-
}
}
}
@@ -2618,6 +2621,10 @@ Session::new_midi_route (RouteGroup* route_group, uint32_t how_many, string name
if (instrument) {
for (RouteList::iterator r = ret.begin(); r != ret.end(); ++r) {
PluginPtr plugin = instrument->load (*this);
+ if (!plugin) {
+ warning << "Failed to add Synth Plugin to newly created track." << endmsg;
+ continue;
+ }
if (pset) {
plugin->load_preset (*pset);
}