On Thursday, 27 May 2021 at 12:59:02 UTC, frame wrote:
But what about the data used in the context of the delegate?

If the delegate is created by the GC and stored it will still be managed by the GC, along with its captured vars.

As long as the GC can see the delegate in your example you should be OK. But if it is held on to by a C or OS lib, the GC might not see it and you'd have to addRoot or something to ensure it stays in.

Reply via email to