Hope you don't mind, I may be missing something; I just need some clarification for the following scenario: If an object a contains a reference to a static list and also an entry in that static list, and object a falls out of scope, will it be garbage collected? Do I need to set object a's reference to the static list and reference to the entry in that list to null before it becomes eligible?
I understand that the static list contains objects which will live for the lifetime of the application, so I was thinking since object a still references an entry in that static list, it is still in the main dependency object graph of objects which are still live?
Thanks in advance
In your case static list will live but a will be garbage collected becuase you cannot access it from any other place and there is no sense to keep it in memory. You don't need to null refference to static list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With