Skip to content

Instantly share code, notes, and snippets.

@kumpera
Created April 25, 2012 14:42
Show Gist options
  • Save kumpera/2490253 to your computer and use it in GitHub Desktop.
Save kumpera/2490253 to your computer and use it in GitHub Desktop.
using System;
using System.Threading;
class Driver {
~Driver () {
Console.WriteLine ("FIN");
throw new Exception ();
}
static void Main () {
var t = new Thread (()=> new Driver ());
AppDomain.CurrentDomain.UnhandledException += (a,b) => Console.WriteLine ("EH {0} {1}", a.GetType (), b.GetType ());
t.Start ();
t.Join ();
GC.Collect ();
GC.WaitForPendingFinalizers ();
Console.WriteLine ("DOES IT PRINT OR DOES IT NOT?");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment