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
correctly.
parent 46d174c4
......@@ -899,6 +899,9 @@ static LONG MSGRemoveContext(SCARDCONTEXT hContext, SCONTEXT * threadContext)
* and simulate a card removal
*/
rv = SCARD_W_REMOVED_CARD;
/* decrement card use */
(void)SCardDisconnect(hCard, SCARD_LEAVE_CARD);
}
else
{
......
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