fix crash when copy'ing latent plugins 5.0
authorRobin Gareus <robin@gareus.org>
Wed, 10 Aug 2016 14:31:56 +0000 (16:31 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 10 Aug 2016 14:32:34 +0000 (16:32 +0200)
libs/ardour/plugin_insert.cc
libs/ardour/route.cc

index bfa86fbc80769006f6c2b36db9faa10f991c56dc..9a0e6c55c40574e32cd001bf5e3df688593e625c 100644 (file)
@@ -555,6 +555,13 @@ PluginInsert::activate ()
        }
 
        Processor::activate ();
+       /* when setting state e.g ProcessorBox::paste_processor_state ()
+        * the plugin is not yet owned by a route.
+        * but no matter.  Route::add_processors() will call activate () again
+        */
+       if (!owner ()) {
+               return;
+       }
        if (_plugin_signal_latency != signal_latency ()) {
                _plugin_signal_latency = signal_latency ();
                latency_changed ();
index 4b14d761ebde62cbd167d54c27376b772bb8f418..11db73241cbd304c629a556828f02611134678c9 100644 (file)
@@ -1019,7 +1019,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
                        }
 
                        if ((*i)->active()) {
-                               // why?  emit  ActiveChanged() ??
+                               // emit ActiveChanged() and latency_changed() if needed
                                (*i)->activate ();
                        }