mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
Move setting of 'checked' to finally block so that other callers cannot use the results before they are ready.
This commit is contained in:
parent
b243933e48
commit
3df6aeb4e9
1 changed files with 30 additions and 27 deletions
|
@ -77,7 +77,6 @@ public class CygwinPathResolver implements IBuildPathResolver {
|
||||||
File file = new File(exePath);
|
File file = new File(exePath);
|
||||||
if (!file.exists() || !file.isDirectory()) { return result; } // no changes
|
if (!file.exists() || !file.isDirectory()) { return result; } // no changes
|
||||||
|
|
||||||
ArrayList ls = new ArrayList();
|
|
||||||
String s = exePath + TOOL + variableValue;
|
String s = exePath + TOOL + variableValue;
|
||||||
String[] lines = exec(s, configuration);
|
String[] lines = exec(s, configuration);
|
||||||
if (lines != null && lines.length > 0) {
|
if (lines != null && lines.length > 0) {
|
||||||
|
@ -121,7 +120,8 @@ public class CygwinPathResolver implements IBuildPathResolver {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private static synchronized void checkRegistry() {
|
private static synchronized void checkRegistry() {
|
||||||
checked = true;
|
if (checked) return;
|
||||||
|
try {
|
||||||
etcCygwin = null;
|
etcCygwin = null;
|
||||||
binCygwin = null;
|
binCygwin = null;
|
||||||
rootCygwin = null;
|
rootCygwin = null;
|
||||||
|
@ -151,6 +151,9 @@ public class CygwinPathResolver implements IBuildPathResolver {
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
checked = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue