#879 – Unhandled Exceptions in Finalizers
July 3, 2013 1 Comment
Like other unhandled exceptions, an exception that is thrown from a finalizer and not handled will cause your application to terminate.
~Dog() { Console.WriteLine( "Dog finalizer is running. I'll throw an exception and your app will terminate"); throw new Exception("Dang it"); }
Dog d = new Dog("Kirby", 15); d.Bark(); d = null; GC.Collect();