Skip to content

Commit

Permalink
Dispose of context to satisfy compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Domzalski committed Jun 28, 2022
1 parent 0f2100c commit d3b2dd0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public DesktopSmartCardDeviceListener()
// has occured. We should not continue, and the device listener should remain dormant.
if (result != ErrorCode.SCARD_S_SUCCESS)
{
context.Dispose(); // Needed to satisfy analyzer (even though it should be null already)
_context = new SCardContext(IntPtr.Zero);
_readerStates = Array.Empty<SCARD_READER_STATE>();
_log.LogWarning("SmartCardDeviceListener dormant as SDK was unable to establish a context to the PCSC service.");
return;
}

Expand Down

0 comments on commit d3b2dd0

Please sign in to comment.