Fix an assertion failure when stopping the transport with an active controllable...
[ardour.git] / libs / ardour / automatable.cc
index 100e7ddb3cc89ae7e0feb4b314791a831dbea6af..392938fde2fa9ee527ddf1905f795fd811976287 100644 (file)
@@ -417,6 +417,13 @@ Automatable::transport_stopped (framepos_t now)
                                = boost::dynamic_pointer_cast<AutomationList>(c->list());
                         
                         if (l) {
+                               /* Stop any active touch gesture just before we mark the write pass
+                                  as finished.  If we don't do this, the transport can end up stopped with
+                                  an AutomationList thinking that a touch is still in progress and,
+                                  when the transport is re-started, a touch will magically
+                                  be happening without it ever have being started in the usual way.
+                               */
+                               l->stop_touch (true, now);
                                 l->write_pass_finished (now);
                                 
                                 if (l->automation_playback()) {