Are child objects still alive when Object.Finalize is called by GC?
问题 Say, I have this class: class Test { readonly object _child = new Object(); // ... ~Test() { // access _child here // ... } } Is the _child object guaranteed to still be alive when ~Test is called by the garbage collector? Or should I first "pin" the _child with GCHandle.Alloc in the constructor? 回答1: Being a readonly field _child you can't lose its reference (unless you set it to null via reflection). Which means that till the Test is garbage collected _child will stay in memory for sure.