]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 2392: Segfault in connection with \applyContext
authorDavid Kastrup <dak@gnu.org>
Sun, 20 Oct 2013 19:53:42 +0000 (21:53 +0200)
committerDavid Kastrup <dak@gnu.org>
Fri, 25 Oct 2013 06:59:33 +0000 (08:59 +0200)
lily/score-performer.cc

index 9dc229a48d09a90cfb0a8180f00b68b2d163bd39..92c6625534b39ffb22477c60d1a209aa9aed26ce 100644 (file)
@@ -131,6 +131,17 @@ IMPLEMENT_LISTENER (Score_performer, one_time_step);
 void
 Score_performer::one_time_step (SCM)
 {
+  // audio_column_ can be 0 when prepare has not been called.  The
+  // condition is triggered when Simple_music_iterator implicitly
+  // creates a Score context, like when writing
+  //
+  // \score { { | c4 c c c } \midi { } }
+  //
+  // The same situation happens with the Score_engraver group, but it
+  // would appear not to suffer any bad side effects.
+
+  if (!audio_column_)
+    audio_column_ = new Audio_column (context ()->get_global_context ()->now_mom ());
   if (to_boolean (context ()->get_property ("skipTypesetting")))
     {
       if (!skipping_)
@@ -174,4 +185,3 @@ Score_performer::initialize ()
 
   Translator_group::initialize ();
 }
-