]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2990: \RemoveEmptyStaves in StaffGroup context crashes
authorDavid Kastrup <dak@gnu.org>
Sun, 23 Dec 2012 14:46:45 +0000 (15:46 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 9 Jan 2013 06:52:01 +0000 (07:52 +0100)
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

index 10ad7f59922796e33043cca02e1d0f31567400e6..3823c3498484cbe9f1cc9e75a035ee1753284960 100644 (file)
@@ -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 ());
 }