lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: disconnect coverage


From: Erik Sandberg
Subject: Re: disconnect coverage
Date: Sat, 6 Jan 2007 13:28:18 +0100
User-agent: KMail/1.9.5

On Thursday 04 January 2007 20:13, Han-Wen Nienhuys wrote:
> Erik Sandberg escreveu:
> > 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.
>
> No, that's incorrect. Removal of contexts is different reclaiming the
> memory. Can you have a look at
>
>   Global_context::run_iterator_on_me
>
> why the check_removal doesn't trigger for the Score context?

Sorry for being unclear. 

check_removal always returns false for Score contexts, it has been that way 
since I joined the project. There is a reason for this: The typeset score is 
stored in the Score_engraver, which in turn is accessed through the 
Global_context returned by ly:run-translator. So the score-translator must be 
connected to the score-context after run-translator finishes.

I plan to change this: we should junk run-translator, and instead keep track 
of both context and translator in the SCM code, and access the typeset score 
directly via the created global-translator. Then it would be possible to 
disconnect score-translators at iteration time.

This is however not high on my todo.

-- 
Erik





reply via email to

[Prev in Thread] Current Thread [Next in Thread]