Fix null sessions in HttpContextWrapper.Session
[mono.git] / mono / tests / finalizer-exception.cs
1 using System;
2 using System.Threading;
3
4 public class FinalizerException {
5         ~FinalizerException () {
6                 throw new Exception ();
7         }
8
9         public static int Main () { 
10                 AppDomain.CurrentDomain.UnhandledException += (sender, args) => {
11                         Console.WriteLine ("caught");
12                         Environment.Exit (0);
13                 };
14
15                 new FinalizerException ();
16
17                 GC.Collect ();
18                 GC.WaitForPendingFinalizers ();
19
20                 Thread.Sleep (Timeout.Infinite); // infinite wait so we don't race against the unhandled exception callback
21
22                 return 2;
23         }
24 }