Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Shutdown daemon threads at the end of dbtest

luccioman28883d8a712f
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();
}
}
}