[feature request] Special method to be called on class instance to ask (and wark object) before garbage collection

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Tue Aug 2 08:15:51 UTC 2022


On Tuesday, 2 August 2022 at 05:23:14 UTC, AnimusPEXUS wrote:
> On Monday, 1 August 2022 at 11:21:43 UTC, vit wrote:
>> GC.addRoot: GC.removeRoot:
>
> thanks, I know about those.
> But my point is not just to preserve objects from being GCed, 
> but object's to be notified before GC, so objects could do some 
> additional cleanups.

You should be able to use object destructor for that. Just be 
warned, don't use pointers in code, they may be obsolete already.


More information about the Digitalmars-d mailing list