Skip to content

Commit

Permalink
Dispose of cached browse config on dispose if no longer registered. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Colengms authored Feb 28, 2023
1 parent 7a76ee1 commit febcf11
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,16 @@ export class CppProperties {
}

dispose(): void {
if (this.lastCustomBrowseConfigurationProviderId !== undefined) {
const config: Configuration | undefined = this.CurrentConfiguration;
if (config !== undefined && config.configurationProvider !== this.lastCustomBrowseConfigurationProviderId.Value) {
this.lastCustomBrowseConfigurationProviderId.Value = undefined;
if (this.lastCustomBrowseConfiguration !== undefined) {
this.lastCustomBrowseConfiguration.Value = undefined;
}
}
}

this.disposables.forEach((d) => d.dispose());
this.disposables = [];

Expand Down

0 comments on commit febcf11

Please sign in to comment.