-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Describe the bug
Not destroyed handles after a new connection is once used (writeasynch) and disposed. It leads to OutOfMemoryException after many iterations in the same process.
Steps to reproduce the bug
-
Create a new pipe client:
_client = new PipeClient(uri, ".", null);
_client.ConnectAsync().Wait(30);
_client.ExceptionOccurred += Client_ExceptionOccurred;
_client.MessageReceived += Client_MessageReceived; -
Write sometihng to server process:
_client.WriteAsync(messageObject).Wait(); -
Dispose client after all done:
_client.ExceptionOccurred -= Client_ExceptionOccurred;
_client.MessageReceived -= Client_MessageReceived;
_client.DisconnectAsync().Wait();
_client.DisposeAsync();
_client = null; -
Iterate 1000 times -> there are about 1000 more handles in the process. Note: if you omit step 2 - everything works clean.
Expected behavior
No additional handles after 1000 iterations within the same client process
Screenshots
No response
NuGet package version
1.14.8
Platform
Console
IDE
Visual Studio 2022, Visual Studio 2019
Additional context
No response