Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encrypting Data
Message
From
10/10/2009 04:15:58
 
 
To
09/10/2009 05:47:39
General information
Forum:
Microsoft SQL Server
Category:
Database design
Title:
Miscellaneous
Thread ID:
01428109
Message ID:
01428623
Views:
51
>
>I have made a small test program - and added the ildasm for TestDispose()
>
>(1) The Console.WriteLine("Dispose") is executed - but is that due to Disposing or the GC ?


It's due to disposing you dummy. How could it be the GC when there's no finalizer ?

>
>If I put a break on [Console.WriteLine("Dispose") ] and look at the stack, it points to the return statement
>
snip
>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");
>		}
>	}
>}
>
>
snip
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform