Skip to content

Commit

Permalink
fix(908): fix for the cmake tool chain removal function. (#909)
Browse files Browse the repository at this point in the history
Resolves that the calculated ID in the removal function was different than the one in the add

Fixes #908
  • Loading branch information
alirana01 authored Oct 8, 2024
1 parent 84b5a4c commit f680907
Showing 1 changed file with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,18 @@ public void addToolChainFile(ICMakeToolChainFile file) {
public void removeToolChainFile(ICMakeToolChainFile file) {
init();
fireEvent(new CMakeToolChainEvent(CMakeToolChainEvent.REMOVED, file));
String tcId = makeToolChainId(file.getProperty(CMakeBuildConfiguration.TOOLCHAIN_TYPE),
file.getProperty(CMakeBuildConfiguration.TOOLCHAIN_ID));
filesByToolChain.remove(tcId);

String n = ((CMakeToolChainFile) file).n;
if (n != null) {
Preferences prefs = getPreferences();
Preferences tcNode = prefs.node(n);
try {
try {
String tcId = makeToolChainId(file.getToolChain());
filesByToolChain.remove(tcId);
String n = ((CMakeToolChainFile) file).n;
if (n != null) {
Preferences prefs = getPreferences();
Preferences tcNode = prefs.node(n);
tcNode.removeNode();
prefs.flush();
} catch (BackingStoreException e) {
Activator.log(e);
}
} catch (CoreException | BackingStoreException e) {
Activator.log(e);
}
}

Expand Down

0 comments on commit f680907

Please sign in to comment.