Skip to content

Commit f680907

Browse files
authored
fix(908): fix for the cmake tool chain removal function. (eclipse-cdt#909)
Resolves that the calculated ID in the removal function was different than the one in the add Fixes eclipse-cdt#908
1 parent 84b5a4c commit f680907

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeToolChainManager.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,18 @@ public void addToolChainFile(ICMakeToolChainFile file) {
156156
public void removeToolChainFile(ICMakeToolChainFile file) {
157157
init();
158158
fireEvent(new CMakeToolChainEvent(CMakeToolChainEvent.REMOVED, file));
159-
String tcId = makeToolChainId(file.getProperty(CMakeBuildConfiguration.TOOLCHAIN_TYPE),
160-
file.getProperty(CMakeBuildConfiguration.TOOLCHAIN_ID));
161-
filesByToolChain.remove(tcId);
162-
163-
String n = ((CMakeToolChainFile) file).n;
164-
if (n != null) {
165-
Preferences prefs = getPreferences();
166-
Preferences tcNode = prefs.node(n);
167-
try {
159+
try {
160+
String tcId = makeToolChainId(file.getToolChain());
161+
filesByToolChain.remove(tcId);
162+
String n = ((CMakeToolChainFile) file).n;
163+
if (n != null) {
164+
Preferences prefs = getPreferences();
165+
Preferences tcNode = prefs.node(n);
168166
tcNode.removeNode();
169167
prefs.flush();
170-
} catch (BackingStoreException e) {
171-
Activator.log(e);
172168
}
169+
} catch (CoreException | BackingStoreException e) {
170+
Activator.log(e);
173171
}
174172
}
175173

0 commit comments

Comments
 (0)