]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3205: opening bar check causes crash if \score contains the \midi block
authorDavid Kastrup <dak@gnu.org>
Wed, 27 Feb 2013 00:26:14 +0000 (01:26 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 5 Mar 2013 21:42:28 +0000 (22:42 +0100)
This derives Bar_check_iterator from Music_iterator rather than from
Simple_music_iterator.

In
\score {
  { | d }
  \midi { }
}

the bar check iterator is being called while only the \Global context
exists.  That causes Score_performer::one_time_step to be called
without getting Score_performer::prepare to be called previously,
probably because the Score context is created at the wrong time.  The
Score_performer is not prepared for this situation.

I have no idea how to fix Simple_music_iterator, why it exists in the
first place and is written like it is, and why this appears to work.

lily/bar-check-iterator.cc

index a0fb8eaee17391231734a889ce2ec7e480615c98..ea4794897d3353f9fddae5c607ffe1f33fd78898 100644 (file)
@@ -27,7 +27,7 @@
   Check bar checks. We do this outside the engravers so that you can
   race through the score using skipTypesetting to correct durations.
 */
-class Bar_check_iterator : Simple_music_iterator
+class Bar_check_iterator : Music_iterator
 {
 public:
   virtual void process (Moment);
@@ -44,7 +44,7 @@ Bar_check_iterator::Bar_check_iterator ()
 void
 Bar_check_iterator::process (Moment m)
 {
-  Simple_music_iterator::process (m);
+  Music_iterator::process (m);
   if (!m.to_bool ())
     {
       Context *tr = get_outlet ();