From 6b9921f0e2b8c73ebb3063109562d97fba898dab Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 20 Oct 2013 21:53:42 +0200 Subject: [PATCH] Issue 2392: Segfault in connection with \applyContext --- lily/score-performer.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lily/score-performer.cc b/lily/score-performer.cc index 9dc229a48d..92c6625534 100644 --- a/lily/score-performer.cc +++ b/lily/score-performer.cc @@ -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 (); } - -- 2.39.5