Skip to content

Commit

Permalink
Merge pull request #1547 from MartinTherriault/master
Browse files Browse the repository at this point in the history
LogReceiverWebServiceTarget is leaking communication channels
  • Loading branch information
304NotModified committed Jul 19, 2016
2 parents 72bfc70 + 0fb4250 commit 698ca65
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/NLog/Targets/LogReceiverWebServiceTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,17 @@ protected virtual IWcfLogReceiverClient CreateLogReceiver()

private void ClientOnProcessLogMessagesCompleted(object sender, AsyncCompletedEventArgs asyncCompletedEventArgs)
{
var client = sender as WcfLogReceiverClient;
var client = sender as IWcfLogReceiverClient;
if (client != null && client.State == CommunicationState.Opened)
{
client.CloseCommunicationObject();
try
{
client.Close();
}
catch
{
client.Abort();
}
}
}
#endif
Expand Down

0 comments on commit 698ca65

Please sign in to comment.