Bugzilla – Bug 312169
Regression test-53 fails on Linux.
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by miguel@ximian.com 2003-04-10 23:37:30 MST ---- The following test fails with Mono/Mini, the "finally" clause of a using statement is not executed when an exception is thrown. using System; class MyDispose : IDisposable { public bool disposed; public void Dispose () { disposed = true; } } class M { static int Main () { // // See if the variable `c' is disposed if there is // an error thrown inside the using block. // MyDispose copy_c = null; try { using (MyDispose c = new MyDispose ()){ copy_c = c; throw new Exception (); } } catch {} if (!copy_c.disposed) Console.WriteLine ("C was not dispossed"); else Console.WriteLine ("Disposal on finally block works"); return 0; } } ---- Additional Comments From lupus@ximian.com 2003-04-15 13:24:54 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO41166 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"