Skip to content

Commit

Permalink
Fix disposing native api
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Jul 22, 2024
1 parent 1cc490b commit e6701fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/client/pythonEnvironments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export async function initialize(ext: ExtensionState): Promise<IDiscoveryAPI> {

if (shouldUseNativeLocator()) {
const finder = getNativePythonFinder();
ext.disposables.push(finder);
const api = createNativeEnvironmentsApi(finder);
ext.disposables.push(api);
registerNewDiscoveryForIOC(
// These are what get wrapped in the legacy adapter.
ext.legacyIOC.serviceManager,
Expand Down
2 changes: 1 addition & 1 deletion src/client/pythonEnvironments/nativeAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class NativePythonEnvironments implements IDiscoveryAPI, Disposable {
}
}

export function createNativeEnvironmentsApi(finder: NativePythonFinder): IDiscoveryAPI {
export function createNativeEnvironmentsApi(finder: NativePythonFinder): IDiscoveryAPI & Disposable {
const native = new NativePythonEnvironments(finder);
native.triggerRefresh().ignoreErrors();
return native;
Expand Down

0 comments on commit e6701fe

Please sign in to comment.