From d40362adfc1c3b24f466b7570e58f92885751019 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 23 Dec 2012 15:46:45 +0100 Subject: [PATCH] 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. --- lily/axis-group-engraver.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ()); } -- 2.39.2