[Mono-bugs] [Bug 82159][Nor] New - WaitHandle: Setting new Handle / SafeWaitHandle should not close or dispose previous handle

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jul 21 17:09:31 EDT 2007


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 gert.driesen at pandora.be.

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

--- shadow/82159	2007-07-21 17:09:31.000000000 -0400
+++ shadow/82159.tmp.18298	2007-07-21 17:09:31.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 82159
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: WaitHandle: Setting new Handle / SafeWaitHandle should not close or dispose previous handle
+
+Even though MSDN2 states that, in .NET 2.0, both the Handle and 
+SafeWaitHandle properties take care of closing the previous handle, the 
+reality is quite the opposite.
+
+Neither of these properties actually close the previous handle.
+
+I'll attach a first simple test application which shows that MS does not 
+close the previous handle (while we do).
+
+I have more tests that demonstrate the same problem with the Handle 
+property.
+
+To reproduce, compile the attached source code using gmcs and run it.
+
+Expected result:
+
+Closed ? False
+
+=> Note: this is the result on the MS implementation, but as I said this 
+does not match the documentation!
+
+Actual result:
+
+Closed ? True
+
+Unhandled Exception: System.ObjectDisposedException: The object was used 
+after being disposed.
+  at System.Runtime.InteropServices.SafeHandle.Close () [0x00000] 
+  at System.Runtime.InteropServices.SafeHandle.Dispose (Boolean disposing) 
+[0x00000] 
+  at System.Runtime.InteropServices.SafeHandle.Dispose () [0x00000] 
+  at Program.Main () [0x00000]


More information about the mono-bugs mailing list