Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encrypting Data
Message
De
10/10/2009 04:15:58
 
 
À
09/10/2009 05:47:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Titre:
Divers
Thread ID:
01428109
Message ID:
01428623
Vues:
52
>
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform