Re: Memory reference that does not stop garbage collection.

2019-02-08 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 8 February 2019 at 15:42:13 UTC, Jonathan Levi wrote: I should be able to use `core.memory.GC.removeRange` right? That would leave dangling references in the array. You may be interested in this, but I have not used it myself: https://repo.or.cz/w/iv.d.git/blob/HEAD:/weakref.d

Memory reference that does not stop garbage collection.

2019-02-08 Thread Jonathan Levi via Digitalmars-d-learn
I have observers and listeners. class Observer { Listener[] listeners; } class Listener {} The observers keep references to listeners, but I would like the GC to garbage collect listeners even if observers have references to it and remove the references in observers. I should be able to