In a program I accidentally called closeHandle()
twice on a mutex handle (closing the handle that was already closed).
When running the code in the debugger, I received the exception error An invalid HANDLE was specified.
as expected.
However, running the program "normally" as a stand alone (outside of the debugger) the exception does not appear or any other error. Program appears to run normally.
Is this just a setting in Visual Studio .NET 2003 or is there more behind it?
The documentation states:
If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With