+void
+AutomationWatch::transport_stop_automation_watches (samplepos_t when)
+{
+ DEBUG_TRACE (DEBUG::Automation, "clear all automation watches\n");
+
+ AutomationWatches tmp;
+
+ {
+ Glib::Threads::Mutex::Lock lm (automation_watch_lock);
+ /* copy automation watches */
+ tmp = automation_watches;
+ /* clear existing container so that each
+ ::remove_automation_watch() call from
+ AutomationControl::stop_touch() is faster.
+ */
+
+ automation_watches.clear ();
+ automation_connections.clear ();
+ }
+
+ for (AutomationWatches::iterator i = tmp.begin(); i != tmp.end(); ++i) {
+ (*i)->stop_touch (when);
+ }
+}
+