Skip to content

Commit febcf11

Browse files
authored
Dispose of cached browse config on dispose if no longer registered. (#10608)
1 parent 7a76ee1 commit febcf11

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,6 +2132,16 @@ export class CppProperties {
21322132
}
21332133

21342134
dispose(): void {
2135+
if (this.lastCustomBrowseConfigurationProviderId !== undefined) {
2136+
const config: Configuration | undefined = this.CurrentConfiguration;
2137+
if (config !== undefined && config.configurationProvider !== this.lastCustomBrowseConfigurationProviderId.Value) {
2138+
this.lastCustomBrowseConfigurationProviderId.Value = undefined;
2139+
if (this.lastCustomBrowseConfiguration !== undefined) {
2140+
this.lastCustomBrowseConfiguration.Value = undefined;
2141+
}
2142+
}
2143+
}
2144+
21352145
this.disposables.forEach((d) => d.dispose());
21362146
this.disposables = [];
21372147

0 commit comments

Comments
 (0)