diff options
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java index e395c8ab820..0a094de7052 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java @@ -101,7 +101,6 @@ public class CommandExecutor { return exitCode; } catch (java.util.concurrent.TimeoutException te) { - process.destroy(); throw new TimeoutException(command, "Timeout exceeded: " + timeoutMilliseconds + " ms", te); } catch (CommandException e) { @@ -111,6 +110,9 @@ public class CommandExecutor { throw new CommandException(command, e); } finally { + if (process != null) { + process.destroy(); + } waitUntilFinish(outputGobbler); waitUntilFinish(errorGobbler); closeStreams(process); |