diff --git a/SingleInstanceManager/SingleInstanceManager.cs b/SingleInstanceManager/SingleInstanceManager.cs index 5714e21..13e7815 100644 --- a/SingleInstanceManager/SingleInstanceManager.cs +++ b/SingleInstanceManager/SingleInstanceManager.cs @@ -139,7 +139,10 @@ private async Task HandleConnection(CancellationToken cancellationToken) // raise the event OnSecondInstanceStarted(args); - + // close reader & server to free resources + // otherwise, the inter process communication will only work twice... + reader.Close(); + server.Close(); } @@ -158,4 +161,4 @@ public void Dispose() _cts?.Dispose(); } } -} \ No newline at end of file +}