changeset 17336:f26cc437ca0e

8169026: Handle smartcard clean up better Reviewed-by: valeriep, ahgross
author igerasim
date Thu, 17 Nov 2016 22:01:02 +0300
parents b7367d560ddd
children 7e4f239413b3
files src/java.smartcardio/share/classes/sun/security/smartcardio/CardImpl.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 {