mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 16:56:04 +02:00
bug 419396: CommandLauncher may hang eclipse
This commit is contained in:
parent
25ea069927
commit
410d532bde
2 changed files with 9 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2012 Andrew Gvozdev and others.
|
||||
* Copyright (c) 2012, 2013 Andrew Gvozdev and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -287,6 +287,8 @@ public class BuildRunnerHelper implements Closeable {
|
|||
if (!isCancelled && project != null) {
|
||||
project.setSessionProperty(progressPropertyName, new Integer(streamProgressMonitor.getWorkDone()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CCorePlugin.log(e);
|
||||
} finally {
|
||||
monitor.done();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2000, 2013 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -17,6 +17,8 @@ import java.io.InputStream;
|
|||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
||||
/**
|
||||
* Bundled state of a launched process including the threads linking the process
|
||||
* in/output to console documents.
|
||||
|
@ -33,11 +35,11 @@ public class ProcessClosure {
|
|||
private OutputStream fOutputStream;
|
||||
private boolean fFinished = false;
|
||||
private String lineSeparator;
|
||||
/*
|
||||
* outputStream can be null
|
||||
*/
|
||||
|
||||
public ReaderThread(ThreadGroup group, String name, InputStream in, OutputStream out) {
|
||||
super(group, name);
|
||||
Assert.isNotNull(in);
|
||||
Assert.isNotNull(out);
|
||||
fOutputStream = out;
|
||||
fInputStream = in;
|
||||
setDaemon(true);
|
||||
|
@ -58,7 +60,6 @@ public class ProcessClosure {
|
|||
// ignore
|
||||
} finally {
|
||||
try {
|
||||
// writer.flush();
|
||||
fOutputStream.flush();
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
|
|
Loading…
Add table
Reference in a new issue