Is this a bug or feature?

BCS ao at pathlink.com
Tue Jan 16 08:11:30 PST 2007


Reply to %u,

> == Quote from Kirk McDonald (kirklin.mcdonald at gmail.com)'s article
> 
>> If you want a delegate with a more persistent context void foo() {
>> 
> Doesn't this solution only work because the newed and collected memory
> is not overwritten? Therefore "more persistent" only means until it is
> overwritten?
> 
> Shouldn't one code
> 
>> static void foo() {
>> 

A delegate is a context/function pointer pair. There for, as long as you 
keep the delegate around, the Foo won't get collected.




More information about the Digitalmars-d-learn mailing list