lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 2990: \RemoveEmptyStaves in StaffGroup context crashes (issue


From: dak
Subject: Re: Issue 2990: \RemoveEmptyStaves in StaffGroup context crashes (issue 7069044)
Date: Thu, 10 Jan 2013 09:00:43 +0000

Reviewers: Keith,

Message:
On 2013/01/10 06:40:08, Keith wrote:
Anything with a line break still causes a crash.  I can't say exactly
why,
because I'm a bit confused which VerticalAxisGroup gets removed, the
outer or
the inner.

The outer group commits suicide once it hears of an inner one.  I tried
it the other way round first (which would appear to make more sense),
but that made the original report bomb out: possibly one would have
needed to better code the case where an outer group is not happy with
creation of an inner one.  It is also possible that this created a
timing problem where the inner group was first created (with the outer
group not being in existence), and then afterwards the outer group being
created and never getting notice of the inner one as its creation time
had already been over.

At any rate, it would appear that listening to the creation messages
(which did not require any additional bookkeeping overhead) is tricky.
If nobody comes up with a "oh, this was just missing $x suggestion" in
due time, it might provide a cleaner slate for a better fix if this
patch gets reverted.

Description:
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.

Please review this at https://codereview.appspot.com/7069044/

Affected files:
  M lily/axis-group-engraver.cc


Index: lily/axis-group-engraver.cc
diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc
index 10ad7f59922796e33043cca02e1d0f31567400e6..3823c3498484cbe9f1cc9e75a035ee1753284960 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 ());
 }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]