From: David Kastrup Date: Sun, 23 Dec 2012 14:46:45 +0000 (+0100) Subject: Issue 2990: \RemoveEmptyStaves in StaffGroup context crashes X-Git-Tag: release/2.17.10-1~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d40362adfc1c3b24f466b7570e58f92885751019;p=lilypond.git Issue 2990: \RemoveEmptyStaves in StaffGroup context crashes The problem is caused by multiple axis group engravers, and in particular nested VerticalAxisGroup grobs in connection with the skyline code. An extensive fix catching any recursive grob definition will lead to quite more cryptic error messages rather than this hand-tailored fix for the special case of VerticalAxisGroup nesting. The solution chosen here is to complain when a VerticalAxisGroup is announced from a subordinate context and let the current group commit suicide. --- diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index 10ad7f5992..3823c34984 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -71,6 +71,16 @@ Axis_group_engraver::finalize () void Axis_group_engraver::acknowledge_grob (Grob_info i) { + if (!staffline_) + return; + if (i.grob ()->name () == "VerticalAxisGroup") { + i.grob ()->programming_error ("duplicate axis group"); + if (staffline_->is_live ()) + staffline_->suicide (); + staffline_ = 0; + elts_.clear (); + return; + } elts_.push_back (i.grob ()); }