changeset 12433:8913fd33ceee

8169026: Handle smartcard clean up better Reviewed-by: valeriep, ahgross
author igerasim
date Fri, 18 Nov 2016 12:25:10 +0300
parents 1bc38fd665ca
children 943db922f29e
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	Thu Jun 08 13:42:20 2017 -0700
+++ 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 {