Is outer reference-type object guaranteed to remain valid after assigned to inner object in nested "using" scope?
A x;
{
using (A y = new A())
{
x = y;
}
}
x.foo(); // Is x rock-solid, guaranteed to be still valid here, or is this iffy? i.e. will the call to x.foo() bomb or work only "by chance"?
I'm concerned because I came across 2 articles talking about premature garbage collection, though their situations are quite different: http://www.curly-brace.com/favorite.html http://www.theserverside.net/tt/articles/showarticle.tss?id=GarbageCollection