No even assuming a more 'real-world' sample than the one you've given here..
The GC will mark all CLR-managed objects for collection that don't have a
'live' reference (reference that is still accessible in all stack frames of
currently running code). You don't have to do any manual work null-ing them
out.
Richard
--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
"C# Learner" <cs****@learner.here> wrote in message
news:e0*************@tk2msftngp13.phx.gbl...
This is probably a silly question but I'll ask to be sure.
Say I have a constructor that looks like this:
public MyClass()
{
items = new string[10];
for (int i = 0; i < items.Length; ++i) {
items[i] = new String();
}
}
Is the following then necessary?
~MyClass()
{
for (int i = 0; i < items.Length; ++i) {
items[i] = null;
}
}