Skip to content

Commit 3e30f9d

Browse files
authored
Ensure native finder is disposed correctly (#24432)
1 parent 3927f66 commit 3e30f9d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/client/pythonEnvironments/base/locators/common/nativePythonFinder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ export function getNativePythonFinder(context?: IExtensionContext): NativePython
463463
if (!_finder) {
464464
const cacheDirectory = context ? getCacheDirectory(context) : undefined;
465465
_finder = new NativePythonFinderImpl(cacheDirectory);
466+
if (context) {
467+
context.subscriptions.push(_finder);
468+
}
466469
}
467470
return _finder;
468471
}

src/client/pythonEnvironments/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export async function initialize(ext: ExtensionState): Promise<IDiscoveryAPI> {
6060

6161
if (shouldUseNativeLocator()) {
6262
const finder = getNativePythonFinder(ext.context);
63-
ext.disposables.push(finder);
6463
const api = createNativeEnvironmentsApi(finder);
6564
ext.disposables.push(api);
6665
registerNewDiscoveryForIOC(

0 commit comments

Comments
 (0)