Skip to content

Instantly share code, notes, and snippets.

@rolfbjarne
Created September 29, 2015 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfbjarne/da71564c202c40ad8ff9 to your computer and use it in GitHub Desktop.
Save rolfbjarne/da71564c202c40ad8ff9 to your computer and use it in GitHub Desktop.
using System;
class T {
public T ()
{
Console.WriteLine ("T");
}
~T ()
{
Console.WriteLine ("~T");
throw new Exception ("T");
}
}
class MainClass
{
public static void Main(string[] args)
{
AppDomain.CurrentDomain.UnhandledException += (sender, args2) =>
{
Console.WriteLine ("Unhandled exception: {0}", sender);
};
for (int i = 0; i < 20000; i++) {
new T ();
GC.Collect ();
}
Console.WriteLine ("done!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment