G
Guest
Consider the following, where Foo implements IDisposable:
try
{
using (Foo myFoo = new Foo())
{
myFoo.Execute();
}
}
catch (someException)
{
// some stuff
}
finally
{
// some other stuff
}
If the call to Foo.Execute() throws an exception, is Foo displosed? My
understanding is that it would be if the TRY...CATCH is inside the USING, but
what happens in the example given above?
Thanks in advance.
/Joel Finkel
try
{
using (Foo myFoo = new Foo())
{
myFoo.Execute();
}
}
catch (someException)
{
// some stuff
}
finally
{
// some other stuff
}
If the call to Foo.Execute() throws an exception, is Foo displosed? My
understanding is that it would be if the TRY...CATCH is inside the USING, but
what happens in the example given above?
Thanks in advance.
/Joel Finkel