summaryrefslogtreecommitdiff
path: root/libs/ardour/automation_list.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-04-20 01:24:46 +0000
committerCarl Hetherington <carl@carlh.net>2011-04-20 01:24:46 +0000
commitb25ef3ae69b83c78da4d98aba32b19eea0d3aac0 (patch)
treef589b2c8d394c63d0949ce55972398525cf254a9 /libs/ardour/automation_list.cc
parent6abc468aeb253ba380fcba09e3c04d08a52b7a35 (diff)
Fix an assertion failure when stopping the transport with an active controllable touch gesture.
git-svn-id: svn://localhost/ardour2/branches/3.0@9389 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/automation_list.cc')
-rw-r--r--libs/ardour/automation_list.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc
index b76fa0bb4b..aaab84f2da 100644
--- a/libs/ardour/automation_list.cc
+++ b/libs/ardour/automation_list.cc
@@ -213,21 +213,30 @@ AutomationList::start_touch (double when)
void
AutomationList::stop_touch (bool mark, double when)
{
+ if (g_atomic_int_get (&_touching) == 0) {
+ /* this touch has already been stopped (probably by Automatable::transport_stopped),
+ so we've nothing to do.
+ */
+ return;
+ }
+
g_atomic_int_set (&_touching, 0);
if (_state == Touch) {
+
+ assert (!nascent.empty ());
+
Glib::Mutex::Lock lm (ControlList::_lock);
if (mark) {
- nascent.back()->end_time = when;
+
+ nascent.back()->end_time = when;
} else {
/* nascent info created in start touch but never used. just get rid of it.
*/
- assert (!nascent.empty ());
-
NascentInfo* ninfo = nascent.back ();
nascent.erase (nascent.begin());
delete ninfo;