From 28883d8a712ff3b997eb549c385c89f5f3428093 Mon Sep 17 00:00:00 2001 From: luccioman Date: Mon, 29 Jan 2018 13:56:37 +0100 Subject: [PATCH] Shutdown daemon threads at the end of dbtest --- source/net/yacy/dbtest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/dbtest.java b/source/net/yacy/dbtest.java index 4e2fd0519..506930427 100644 --- a/source/net/yacy/dbtest.java +++ b/source/net/yacy/dbtest.java @@ -289,9 +289,10 @@ public class dbtest { // start test final long startup = System.currentTimeMillis(); + memprofiler profiler = null; try { // create a memory profiler - final memprofiler profiler = new memprofiler(1024, 320, 120, new File(tablename_test + ".profile.png")); + profiler = new memprofiler(1024, 320, 120, new File(tablename_test + ".profile.png")); profiler.start(); // create the database access @@ -432,6 +433,11 @@ public class dbtest { profiler.terminate(); } catch (final Exception e) { ConcurrentLog.logException(e); + } finally { + if(profiler != null) { + profiler.terminate(); + } + ConcurrentLog.shutdown(); } } }