]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/music-wrapper-iterator.cc
* Documentation/user/refman.itely: bugfix: "Chord namess" ->
[lilypond.git] / lily / music-wrapper-iterator.cc
index 4980c9344ff0322ba5249a3bae641bf8431d074c..38e00b73449a5b9200524121c9e721f8a4b907a3 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
  */
 
 
@@ -18,23 +18,33 @@ Music_wrapper_iterator::Music_wrapper_iterator ()
 Music_wrapper_iterator::Music_wrapper_iterator (Music_wrapper_iterator const &src)
   : Music_iterator (src)
 {
-  if (src.child_iter_)
-    child_iter_ = src.child_iter_->clone ();
-  else
-    child_iter_ = 0;
+  child_iter_ = 0;
+  if  (src.child_iter_)
+  {
+    child_iter_ = src.child_iter_->clone () ;
+    scm_gc_unprotect_object (child_iter_->self_scm());
+  }
 }
 
-Music_wrapper_iterator::~Music_wrapper_iterator ()
+void
+Music_wrapper_iterator::do_quit()
 {
-  delete child_iter_;
+  child_iter_->quit();
+}
+
+void
+Music_wrapper_iterator::derived_mark () const
+{
+  if (child_iter_)
+    scm_gc_mark (child_iter_->self_scm());
 }
 
 
 void
 Music_wrapper_iterator::construct_children ()
 {
-  child_iter_ =
-    get_iterator (dynamic_cast<Music_wrapper const*> (get_music ())->element ());
+  Music * m =  dynamic_cast<Music_wrapper const*> (get_music ())-> element();  
+  child_iter_ = unsmob_iterator (get_iterator (m));
 }
 
 bool
@@ -45,15 +55,6 @@ Music_wrapper_iterator::ok () const
 void
 Music_wrapper_iterator::skip (Moment m)
 {
-  /*
-    FIXME: should make sure that the initial try_music () is skipped as
-    well, if you would do
-
-    iter = get_iterator (Side_effect_music); // eg. property setting
-    iter->skip (1/2)
-    iter->process ()
-
-  */
   child_iter_->skip (m);
 }