When a new shortest duration is added to a beam, the beam is
rechecked for desired division. Prior to this fix, the tuplet
multiplication factor was ignored when calculating the duration
of each note in the beam during the recheck.
Fix potential memory leak in beaming-pattern::end_moment
--- /dev/null
+\version "2.15.34"
+
+\header {
+
+ texidoc = "Autobeam rechecking works properly with tuplets.
+In the example, the first beat should be beamed completely together."
+
+}
+
+\relative c' {
+ \time 2/4
+ c16 c
+ \times 2/3 { c8 c16 }
+ \times 2/3 { c8 c16 }
+ c16 c
+}
-Beam_rhythmic_element::Beam_rhythmic_element (Moment m, int i, bool inv,
+Beam_rhythmic_element::Beam_rhythmic_element (Moment m, int i, bool inv,
Rational factor, bool tuplet_start)
{
start_moment_ = m;
Rational factor, bool tuplet_start)
{
start_moment_ = m;
Moment
Beaming_pattern::end_moment (int i) const
{
Moment
Beaming_pattern::end_moment (int i) const
{
- Duration *dur = new Duration (2 + max (beamlet_count (i, LEFT),
- beamlet_count (i, RIGHT)),
- 0);
+ Duration dur (2 + max (beamlet_count (i, LEFT),
+ beamlet_count (i, RIGHT)),
+ 0);
- return infos_.at (i).start_moment_ + dur->get_length ();
+ return infos_.at (i).start_moment_
+ + infos_.at(i).factor_ * dur.get_length ();