8169026: Handle smartcard clean up better
authorigerasim
Thu, 17 Nov 2016 22:01:02 +0300
changeset 47405 7d686ef404c5
parent 47404 e0aec2769cff
child 47406 f074c11b8fbf
8169026: Handle smartcard clean up better Reviewed-by: valeriep, ahgross
src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java
--- a/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java	Fri Oct 28 21:33:09 2016 +0300
+++ b/src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java	Thu Nov 17 22:01:02 2016 +0300
@@ -270,7 +270,7 @@
     }
 
     public String toString() {
-        return "PC/SC card in " + terminal.getName()
+        return "PC/SC card in " + terminal.name
             + ", protocol " + getProtocol() + ", state " + state;
     }
 
@@ -278,6 +278,7 @@
     protected void finalize() throws Throwable {
         try {
             if (state == State.OK) {
+                state = State.DISCONNECTED;
                 SCardDisconnect(cardId, SCARD_LEAVE_CARD);
             }
         } finally {