]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/repeated-music.cc
release: 1.3.83
[lilypond.git] / lily / repeated-music.cc
index f817ab0d3332d1f41871fa87b02af96c68c91d6d..baae892504bdaaeacae5a84de6dc5d593b004a85 100644 (file)
@@ -26,7 +26,11 @@ Repeated_music::alternatives ()const
 
 Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts)
 {
-  set_mus_property ("body", beg->self_scm ());
+  if (beg)
+    {
+      set_mus_property ("body", beg->self_scm ());
+      scm_unprotect_object (beg->self_scm ());
+    }
   fold_b_ = false;
   repeats_i_ = times;
   volta_fold_b_ = true;
@@ -34,10 +38,8 @@ Repeated_music::Repeated_music(Music *beg, int times, Music_sequence * alts)
     {
       alts->truncate (times);
       set_mus_property ("alternatives", alts->self_scm ());
+      scm_unprotect_object (alts->self_scm ());  
     }
-
-  scm_unprotect_object (beg->self_scm ());
-  scm_unprotect_object (alts->self_scm ());  
 }
 
 Repeated_music::Repeated_music (Repeated_music const &s)
@@ -50,20 +52,6 @@ Repeated_music::Repeated_music (Repeated_music const &s)
 }
 
 
-void
-Repeated_music::do_print () const
-{
-#ifndef NPRINT
-  DEBUG_OUT << "Fold = " << fold_b_ << " reps: " << repeats_i_;
-
-  if (body ())
-    body ()->print();
-  
-  if (alternatives ())
-    alternatives ()->print();
-#endif
-}
-
 Musical_pitch
 Repeated_music::to_relative_octave (Musical_pitch p)
 {