Skip to content

Commit

Permalink
Ensure native finder is disposed correctly (microsoft#24432)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig authored Nov 12, 2024
1 parent 3927f66 commit 3e30f9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ export function getNativePythonFinder(context?: IExtensionContext): NativePython
if (!_finder) {
const cacheDirectory = context ? getCacheDirectory(context) : undefined;
_finder = new NativePythonFinderImpl(cacheDirectory);
if (context) {
context.subscriptions.push(_finder);
}
}
return _finder;
}
Expand Down
1 change: 0 additions & 1 deletion src/client/pythonEnvironments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export async function initialize(ext: ExtensionState): Promise<IDiscoveryAPI> {

if (shouldUseNativeLocator()) {
const finder = getNativePythonFinder(ext.context);
ext.disposables.push(finder);
const api = createNativeEnvironmentsApi(finder);
ext.disposables.push(api);
registerNewDiscoveryForIOC(
Expand Down

0 comments on commit 3e30f9d

Please sign in to comment.