summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-04-23 02:30:16 +0200
committerRobin Gareus <robin@gareus.org>2020-04-23 02:30:16 +0200
commit6b10987e4bd9961b6603b426eae087ee49e1bca5 (patch)
tree7ba6e74ee5299c1d7e3dd8a2053db434051fb89f /libs
parentc264ab6c95988d20158e175f9006de44ff061c50 (diff)
Fix Auditioner edge-case when synth cannot be loaded
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/auditioner.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc
index ba51922a8f..079677ae4c 100644
--- a/libs/ardour/auditioner.cc
+++ b/libs/ardour/auditioner.cc
@@ -135,7 +135,9 @@ Auditioner::load_synth (bool need_lock)
unload_synth(need_lock);
boost::shared_ptr<Plugin> p = audition_synth_info->load (_session);
- asynth = boost::shared_ptr<Processor> (new PluginInsert (_session, p));
+ if (p) {
+ asynth = boost::shared_ptr<Processor> (new PluginInsert (_session, p));
+ }
}
void
@@ -143,10 +145,9 @@ Auditioner::unload_synth (bool need_lock)
{
if (asynth) {
asynth->drop_references ();
+ remove_processor (asynth, NULL, need_lock);
}
- if (0 == remove_processor (asynth, NULL, need_lock)) {
- asynth.reset ();
- }
+ asynth.reset ();
}
int