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>
*/
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
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);
}