Skip to content

Instantly share code, notes, and snippets.

@rolfbjarne

rolfbjarne/test.cs Secret

Created Sep 29, 2015
Embed
What would you like to do?
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