On Monday, 30 November 2020 at 14:36:08 UTC, FeepingCreature
wrote:
On Monday, 30 November 2020 at 14:33:22 UTC, realhet wrote:
...
Though you may want to do `items = null;` too.
I just forgot 1 of three things, thx for pointing it out.
And I also forget to notify the parent to remove the refer
On Monday, 30 November 2020 at 14:33:22 UTC, realhet wrote:
Hi,
class A{
A parent;
A[] items;
void myDestroy(){
items.each!(i => i.myDestroy);
parent = null;
// after this point I think the GC will release it
automatically, and it will call ~this() too. Am I right?
}
}
I
Hi,
class A{
A parent;
A[] items;
void myDestroy(){
items.each!(i => i.myDestroy);
parent = null;
// after this point I think the GC will release it
automatically, and it will call ~this() too. Am I right?
}
}
I have a hierarchy of class instances forward and backward link