Proper desctructor for an class containing dynamic array of objects
Rumbu
rumbu at rumbu.ro
Fri Jun 14 04:59:00 UTC 2019
On Thursday, 13 June 2019 at 16:08:52 UTC, Mike wrote:
> How would a proper destructor of class Foo look like?
> Is it enough to set "array" to null? Or do I have to set every
> element of the array to null and then the array, or nothing of
> that at all because the garbage collecter collects it, if the
> reference to Foo is set to null?
Nothing at all, GC will take care. As long as your Block class
doesn't create any system resources that must be discarded.
More information about the Digitalmars-d-learn
mailing list