From b5db7fc557105371fc7ad789942bbb8ac375bf1a Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Sun, 16 Jul 2017 15:55:51 +0200 Subject: [PATCH] Add try catch for unlock call --- .../java/io/bisq/network/p2p/network/Connection.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/network/src/main/java/io/bisq/network/p2p/network/Connection.java b/network/src/main/java/io/bisq/network/p2p/network/Connection.java index 5671d74884..3926e1c646 100644 --- a/network/src/main/java/io/bisq/network/p2p/network/Connection.java +++ b/network/src/main/java/io/bisq/network/p2p/network/Connection.java @@ -498,12 +498,14 @@ public class Connection implements MessageListener { log.error("Exception at shutdown. " + e.getMessage()); e.printStackTrace(); } finally { - if (protoOutputStreamLock.isLocked()) - protoOutputStreamLock.unlock(); + try { + if (protoOutputStreamLock.isLocked()) + protoOutputStreamLock.unlock(); + } catch (Throwable ignore) { + } try { protoOutputStream.close(); - } catch (IOException e) { - e.printStackTrace(); + } catch (Throwable ignore) { } MoreExecutors.shutdownAndAwaitTermination(singleThreadExecutor, 500, TimeUnit.MILLISECONDS);