From c83a3afbc51c62769cbb8963371d37b312bbcd42 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Wed, 27 Feb 2013 01:26:14 +0100 Subject: [PATCH] Issue 3205: opening bar check causes crash if \score contains the \midi block 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lily/bar-check-iterator.cc b/lily/bar-check-iterator.cc index a0fb8eaee1..ea4794897d 100644 --- a/lily/bar-check-iterator.cc +++ b/lily/bar-check-iterator.cc @@ -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 (); -- 2.39.2