Commit c3bcdeb7 authored by Ludovic Rousseau's avatar Ludovic Rousseau

MSGRemoveContext(): always disconnect the card

We need to call SCardDisconnect() in all cases so that the card use
counter is always decremented when a client disappear.

- when no lock is in use
- when a lock is in use
  - but the lock is held by another context
  - the lock is held by the current context

The bug effect was that smart card auto power off was not working
parent 46d174c4
......@@ -899,6 +899,9 @@ static LONG MSGRemoveContext(SCARDCONTEXT hContext, SCONTEXT * threadContext)
* and simulate a card removal
/* decrement card use */
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment