提交 64f4e28d 编写于 作者: I igerasim

8169026: Handle smartcard clean up better

Reviewed-by: valeriep, ahgross
上级 fea9ec55
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -280,13 +280,14 @@ final class CardImpl extends Card { ...@@ -280,13 +280,14 @@ final class CardImpl extends Card {
} }
public String toString() { public String toString() {
return "PC/SC card in " + terminal.getName() return "PC/SC card in " + terminal.name
+ ", protocol " + getProtocol() + ", state " + state; + ", protocol " + getProtocol() + ", state " + state;
} }
protected void finalize() throws Throwable { protected void finalize() throws Throwable {
try { try {
if (state == State.OK) { if (state == State.OK) {
state = State.DISCONNECTED;
SCardDisconnect(cardId, SCARD_LEAVE_CARD); SCardDisconnect(cardId, SCARD_LEAVE_CARD);
} }
} finally { } finally {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册