1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 189090 - fix missing CygPath.dispose() call.

This commit is contained in:
Doug Schaefer 2007-06-07 16:50:54 +00:00
parent e32f4eb9ec
commit 5969af9ce6

View file

@ -32,7 +32,6 @@ import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
public class ErrorParserManager extends OutputStream { public class ErrorParserManager extends OutputStream {
@ -60,10 +59,6 @@ public class ErrorParserManager extends OutputStream {
private boolean hasErrors = false; private boolean hasErrors = false;
// Cygpath helpers
private CygPath cygpath;
private boolean cygpathInstalled = Platform.getOS().equals(Platform.OS_WIN32);
public ErrorParserManager(ACBuilder builder) { public ErrorParserManager(ACBuilder builder) {
this(builder.getProject(), builder); this(builder.getProject(), builder);
} }
@ -301,10 +296,10 @@ public class ErrorParserManager extends OutputStream {
} }
// That didn't work, see if it is a cygpath // That didn't work, see if it is a cygpath
if (file == null && cygpathInstalled) { if (file == null) {
CygPath cygpath = null;
try { try {
if (cygpath == null) cygpath = new CygPath();
cygpath = new CygPath();
fp = new Path(cygpath.getFileName(filePath)); fp = new Path(cygpath.getFileName(filePath));
if (fBaseDirectory.isPrefixOf(fp)) { if (fBaseDirectory.isPrefixOf(fp)) {
int segments = fBaseDirectory.matchingFirstSegments(fp); int segments = fBaseDirectory.matchingFirstSegments(fp);
@ -313,11 +308,12 @@ public class ErrorParserManager extends OutputStream {
path = fp; path = fp;
} }
file = findFileInWorkspace(path); file = findFileInWorkspace(path);
} catch (IOException e) {
// cygpath must not be installed, don't try this again
cygpathInstalled = false;
} catch (Exception e) { } catch (Exception e) {
} }
finally {
if (cygpath != null)
cygpath.dispose();
}
} }
// We have to do another try, on Windows for cases like "TEST.C" vs "test.c" // We have to do another try, on Windows for cases like "TEST.C" vs "test.c"