Description
Message:
System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'Microsoft.Win32.SafeHandles.SafeWaitHandle'.
Stack Trace:
SafeHandle.DangerousAddRef(Boolean& success)
Kernel32.SetEvent(SafeWaitHandle handle)
EventWaitHandle.Set()
Mailbox`1.Post(TMsg msg) line 193
FSharpMailboxProcessor`1.Post(TMsg message) line 419
I can see the above exception occasionally in this test:
I assume the expected behavior here is no exception?
I'll try to come up with consistent minimal repro, but the problem seems to be here:
fsharp/src/FSharp.Core/mailbox.fs
Lines 189 to 193 in 69fa88b
ev
is disposed and Set
will fail.
The fix seems to be to also assign null to pulse
when disposing it here:
fsharp/src/FSharp.Core/mailbox.fs
Lines 336 to 346 in 69fa88b
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done