summaryrefslogtreecommitdiff
path: root/gtk2_ardour/tempo_lines.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-04-11 10:08:03 +0000
committerCarl Hetherington <carl@carlh.net>2012-04-11 10:08:03 +0000
commitd3775ac42bdb2aac506e5448ecc0b9b10dbd2848 (patch)
treebf42bc43db44afe6fce101613da15b27a0d18161 /gtk2_ardour/tempo_lines.cc
parentd99311d21ba47338920abdb0acf3f95cf9ad8639 (diff)
Slightly expanded version of patch from epitech_user to
fix use of invalidated iterator (#4823). git-svn-id: svn://localhost/ardour2/branches/3.0@11889 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/tempo_lines.cc')
-rw-r--r--gtk2_ardour/tempo_lines.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc
index 2cab60c157..ace2426bac 100644
--- a/gtk2_ardour/tempo_lines.cc
+++ b/gtk2_ardour/tempo_lines.cc
@@ -174,6 +174,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
// Steal from the right
if (left->first > needed_left && li != steal && steal->first > needed_right) {
//cout << "*** STEALING FROM RIGHT" << endl;
+ double const x = steal->first;
line = steal->second;
_lines.erase(steal);
line->property_x1() = xpos;
@@ -185,7 +186,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
// Shift clean range left
_clean_left = min(_clean_left, xpos);
- _clean_right = min(_clean_right, steal->first);
+ _clean_right = min(_clean_right, x);
// Move this line to where we need it
} else {
@@ -230,6 +231,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
//cout << "*** STEALING FROM LEFT" << endl;
assert(_lines.find(xpos) == _lines.end());
Lines::iterator steal = _lines.begin();
+ double const x = steal->first;
line = steal->second;
_lines.erase(steal);
line->property_color_rgba() = color;
@@ -240,7 +242,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
invalidated = true;
// Shift clean range right
- _clean_left = max(_clean_left, steal->first);
+ _clean_left = max(_clean_left, x);
_clean_right = max(_clean_right, xpos);
}
}