[Mono-bugs] [Bug 29534][Nor] New - Finalizers not called properly

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
27 Aug 2002 20:52:45 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gonzalo@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=29534

--- shadow/29534	Tue Aug 27 16:52:45 2002
+++ shadow/29534.tmp.7805	Tue Aug 27 16:52:45 2002
@@ -0,0 +1,60 @@
+Bug#: 29534
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Finalizers not called properly
+
+Steps to reproduce the problem:
+1. Try this:
+using System;
+class A
+{
+	public A ()
+	{
+		throw new NotImplementedException ();
+	}
+
+	~A ()
+	{
+		Console.WriteLine ("Destructor");
+	}
+}
+
+class C
+{
+	
+	static void Main ()
+	{
+		try {
+			A a = new A ();
+		} catch {
+			GC.Collect ();
+		}
+	}
+}
+
+either throwing the exception or not.
+
+
+Actual Results:
+(no output)
+
+
+Expected Results:
+Destructor
+
+Additional Information:
+Under MS runtime, finalizers are called in both cases (throwing exception
+and not).