fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / plugin_insert.cc
index a7e512713df73cfb4fa1ffa6debad362ce4b732c..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 ();
@@ -2161,7 +2168,7 @@ PluginInsert::automatic_can_support_io_configuration (ChanCount const & inx, Cha
 
        uint32_t f             = 0;
        bool     can_replicate = true;
-       for (DataType::iterator t = DataType::begin(); t != DataType::end() && can_replicate; ++t) {
+       for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
 
                // ignore side-chains
                uint32_t nin = ns_inputs.get (*t);