How to use destroy and free.

Salih Dincer salihdb at hotmail.com
Mon Apr 25 10:20:02 UTC 2022


On Monday, 25 April 2022 at 10:13:43 UTC, Alain De Vos wrote:
> destructor of this code :
>
> ```d
>  ~this(){
> 	writeln("Free heap");
> 	import object: destroy;
> 	import core.memory: GC;
> 	i=null;
> 	// But How to force destroy and free , GC-cycle for heap 
> object i ?
> };
> ```

If you use destroy in destructor (~this), it will call destructor 
two times but thats not error.

SDB at 79


More information about the Digitalmars-d-learn mailing list