From 71eddca87402158bf376ab973eac02528af6ed32 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Fri, 6 Nov 2015 18:06:42 +0300 Subject: [PATCH] thread leaks --- .../testSrc/com/intellij/openapi/util/io/IoTestUtil.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java b/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java index 1e6e6deb03c8..ebc96ce401fd 100644 --- a/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java +++ b/platform/util/testSrc/com/intellij/openapi/util/io/IoTestUtil.java @@ -208,7 +208,7 @@ public class IoTestUtil { private static int runCommand(final ProcessBuilder command) throws IOException, InterruptedException { command.redirectErrorStream(true); final Process process = command.start(); - new Thread(new Runnable() { + Thread thread = new Thread(new Runnable() { @Override public void run() { try { @@ -228,8 +228,11 @@ public class IoTestUtil { throw new RuntimeException(e); } } - },"io test").start(); - return process.waitFor(); + }, "io test"); + thread.start(); + int ret = process.waitFor(); + thread.join(); + return ret; } public static void assertTimestampsEqual(final long expected, final long actual) {