Skip to content

Commit

Permalink
Fix WPF RelayCommand binding issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 27, 2023
1 parent 62edeab commit 4578915
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Agent/Services/ChatClientService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,20 @@ public ChatClientService(IAppLauncher appLauncher)
SlidingExpiration = TimeSpan.FromMinutes(10),
RemovedCallback = new CacheEntryRemovedCallback(args =>
{
var chatSession = (args.CacheItem.Value as ChatSession);
chatSession.PipeStream.Dispose();
Process.GetProcessById(chatSession.ProcessID)?.Kill();
try
{
if (args.CacheItem.Value is not ChatSession chatSession)
{
return;
}
chatSession.PipeStream.Dispose();
var chatProcess = Process.GetProcessById(chatSession.ProcessID);
if (chatProcess?.HasExited == false)
{
chatProcess.Kill();
}
}
catch { }
})
};

Expand Down

0 comments on commit 4578915

Please sign in to comment.