http://codereview.appspot.com/5729051/diff/1001/lily/span-bar-stub-engraver.cc File lily/span-bar-stub-engraver.cc (right):
http://codereview.appspot.com/5729051/diff/1001/lily/span-bar-stub-engraver.cc#newcode71 lily/span-bar-stub-engraver.cc:71: axis_groups_ = scm_cons (scm_cons (i.grob ()->self_scm (), i.context ()->self_scm ()), axis_groups_); On 2012/03/04 07:26:30, dak wrote:
axis_groups_ never gets cleared out again: this keeps grobs and
contexts alive
at least until the engraver is collected.
This is the point. I was wrong to suggest before that it be cleared out. Unless the score is insane, a context like PianoStaff will only ever house 10ish contexts and 10 vertical axis groups max. So the size will stay tiny. I could clear this out, but the problem is that LilyPond doesn't provide a mechanism to signal when VerticalAxisGroups are no longer being used. If announce_end_spanner were called on them, I could acknowledge that in the engraver. A separate tracker issue could be opened for that. http://codereview.appspot.com/5729051/diff/1001/lily/span-bar-stub-engraver.cc#newcode81 lily/span-bar-stub-engraver.cc:81: if (!vertical_alignment) // we are at the beginning of a score, so no need for stubs On 2012/03/04 07:26:30, dak wrote:
If "we are at the beginning of the score" is a valid state here,
scm_caar
(axis_groups_) is likely to throw an exception.
This is not possible because process_acknowledged is called after all other process calls, so the list will be populated. However, I agree that an extra check here couldn't hurt. http://codereview.appspot.com/5729051/diff/1001/lily/span-bar-stub-engraver.cc#newcode127 lily/span-bar-stub-engraver.cc:127: for (vsize j = 0; j < affected_contexts.size (); j++) On 2012/03/04 07:26:30, dak wrote:
While you are at it: how about throwing out all of the reverses and
instead
letting the loop run backwards?
This is vestigial code from when I was doing sorting on the span bar vector. It is no longer necessary, so removed. http://codereview.appspot.com/5729051/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel