WaveOutClose never called when WaveOutSafeHandle is closed


In the WaveOutSafeHandle.ReleaseHandle() method, "this.IsClosed" is always True, resulting in not calling WaveOutClose() and leaving handles open. This problem may also occur for WaveInSafeHandle.
Closed Jan 8, 2010 at 8:11 PM by
Resolved: Fixed


otac0n wrote Jan 5, 2010 at 6:47 PM

Since this class inherits from SafeHandleZeroOrMinusOneIsInvalid, this.IsClosed is managed by the parent class, is it not?

otac0n wrote Jan 5, 2010 at 6:57 PM

Also, upon debugging using the newly created demo project, I have inspected the IsClosed value in the Close() method (called by the Dispose method). The handle does indeed show "this.IsClosed == False".

However, during an application exit, "this.handle.Close()" is never called due to the termination of the final thread. However, after the application exits, the OS will successfully clean up the handle.

Marking as closed, could not reproduce.

otac0n wrote Jan 5, 2010 at 7:10 PM

Could not Reproduce. "this.IsClosed" is indeed false, since it inherits from SafeHandleZeroOrMinusOneIsInvalid

** Closed by otac0n 1/5/2010 11:57 AM

otac0n wrote Jan 5, 2010 at 7:10 PM

Found reproduction path.

otac0n wrote Jan 5, 2010 at 7:12 PM

Alright, well, it apperars that I didn't read the documentation of the "SafeHandle.ReleaseHandle" method well enough. Since the method is guaranteed to only be called once, and only if the handle is indeed valid, the check against this.IsClosed was unnecessary and incorrect. Look for a fix soon.