Is AppDomain Finalizing For Unload(), Environment.HasShutdownStarted
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
public sealed class MainClass
{
static void Main()
{
AppDomain currentDomain = AppDomain.CurrentDomain;
if( !currentDomain.IsFinalizingForUnload() &&!Environment.HasShutdownStarted ) {
Console.WriteLine( "Failed to dispose of object!!!" );
Console.WriteLine( "Object allocated at:" );
}
}
}
Output Failed to dispose of object!!!
Object allocated at:
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|