On Thursday 04 January 2007 14:43, Han-Wen Nienhuys wrote:
> Hi Erik,
>
> browsing the coverage reports, I see
>
> **
> uncovered chunk in out-cov/score-performer.cc.gcov
>    #####:      77:Score_performer::disconnect_from_context ()
>        -:      78:{
>    #####:      79:  Dispatcher *d = context ()->get_global_context
> ()->event_source (); #####:      80:  d->remove_listener (GET_LISTENER
> (one_time_step), ly_symbol2scm ("OneTimeStep")); #####:      81: 
> d->remove_listener (GET_LISTENER (prepare), ly_symbol2scm ("Prepare"));
> #####:      82:  d->remove_listener (GET_LISTENER (finish), ly_symbol2scm
> ("Finish")); -:      83:
>    #####:      84:  Performer_group::disconnect_from_context ();
>    #####:      85:}
> uncovered chunk in out-cov/score-engraver.cc.gcov
>    #####:     103:Score_engraver::disconnect_from_context ()
>        -:     104:{
>    #####:     105:  Dispatcher *d = context ()->get_global_context
> ()->event_source (); #####:     106:  d->remove_listener (GET_LISTENER
> (one_time_step), ly_symbol2scm ("OneTimeStep")); #####:     107: 
> d->remove_listener (GET_LISTENER (prepare), ly_symbol2scm ("Prepare"));
> #####:     108:  d->remove_listener (GET_LISTENER (finish), ly_symbol2scm
> ("Finish")); -:     109:
>    #####:     110:  Engraver_group::disconnect_from_context ();
>    #####:     111:}
> **
>
> it seems this is never executed. Can you check this out, and either
> remove the code, or fix it?

They are there for completeness. I think the reason they are never called, is 
that score contexts aren't explicitly destroyed. I think this is because 
contexts below Score are destroyed during iteration, while scores themselves 
aren't (probably because they contain references to the typeset score, which 
is needed later). Scores and score-translators are therefore only removed by 
the GC, so the destructors are never executed.

I don't think this is a problem, and if we remove the code, we may create 
leaks if score translators can be connected/disconnected some time in the 
future.

-- 
Erik


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to