using (Stuff1 stf1 = new Stuff1(...)) // Allocation of stf1
using (Stuff2 stf2 = new Stuff2(...)) // Allocation of stf2
{
try
{
// ... do stuff with stf1 and stf2 here ...
}
catch (Stuff1Exception ex1)
{
// ...
}
catch (Stuff2Exception ex2)
{
// ...
}
} // Automatic deterministic destruction through Dispose() for stf1/stf2 - but in which order?
In other words, is stf2's Dispose() method guaranteed to be called first and then stf1's Dispose() method guaranteed to be called second? (basically: Dispose() methods being called in reverse order of the allocation of the object that they belong to?)