>namespace BaseTest
>{
>
>
> class test2
> {
>
> //______________________________________________________________________
> static void Main()
> {
> TestDispose();
> Console.ReadLine();
> }
> //______________________________________________________________________
> static void TestDispose()
> {
>
> using ( var xx = new Mine() )
> {
>
>
> return;
> }
>
> }
> //______________________________________________________________________
> }
>
> class Mine : IDisposable
> {
> public void Dispose()
> {
> Console.WriteLine("Dispose");
> }
> }
>}
>
>>.method private hidebysig static void TestDispose() cil managed >{ > // Code size 28 (0x1c) > .maxstack 2 > .locals init ([0] class BaseTest.Mine xx, > [1] bool CS$4$0000) > IL_0000: nop > IL_0001: newobj instance void BaseTest.Mine::.ctor() > IL_0006: stloc.0 > .try > { > IL_0007: nop > IL_0008: leave.s IL_001a > } // end .try > finally > { > IL_000a: ldloc.0 > IL_000b: ldnull > IL_000c: ceq > IL_000e: stloc.1 > IL_000f: ldloc.1 > IL_0010: brtrue.s IL_0019 > IL_0012: ldloc.0 > IL_0013: callvirt instance void [mscorlib]System.IDisposable::Dispose() > IL_0018: nop > IL_0019: endfinally > } // end handler > IL_001a: nop > IL_001b: ret >} // end of method test2::TestDispose >