changeset 12583:57fb00fcd20f

8169026: Handle smartcard clean up better Reviewed-by: valeriep, ahgross
author igerasim
date Fri, 18 Nov 2016 12:25:10 +0300
parents b171d4533268
children df08a0e7f22c
files src/share/classes/sun/security/smartcardio/CardImpl.java
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/smartcardio/CardImpl.java	Wed Nov 16 15:49:39 2016 +0000
+++ b/src/share/classes/sun/security/smartcardio/CardImpl.java	Fri Nov 18 12:25:10 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -280,13 +280,14 @@
     }
 
     public String toString() {
-        return "PC/SC card in " + terminal.getName()
+        return "PC/SC card in " + terminal.name
             + ", protocol " + getProtocol() + ", state " + state;
     }
 
     protected void finalize() throws Throwable {
         try {
             if (state == State.OK) {
+                state = State.DISCONNECTED;
                 SCardDisconnect(cardId, SCARD_LEAVE_CARD);
             }
         } finally {