posted 14 years ago
Hi,
I have come across some code in our application:
I have asked the developer why it's there and why he doesn't just use collection = null, his answer is that calling = null will leave the objects in the collection stuck and they won't be garbage collected thus causing a memory leak. Can someone confirm if this is true? I always thought that if objecta references objectb but objecta is not referenced then both would be garbage collected.