mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-34622 For async roots listener use SDK itself as the disposal anchor if possible
Otherwise, we might get stale VFS events when SDK has already been deleted from the SDK table. GitOrigin-RevId: c9331c3dbba7bec6b80161855360154b1df297a4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dc7b8340fa
commit
d048fdfe62
@@ -16,6 +16,7 @@
|
||||
package com.jetbrains.python.packaging;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -521,6 +522,7 @@ public class PyPackageUtil {
|
||||
*/
|
||||
public static void runOnChangeUnderInterpreterPaths(@NotNull Sdk sdk, @NotNull Runnable runnable) {
|
||||
final Application app = ApplicationManager.getApplication();
|
||||
final Disposable disposable = sdk instanceof Disposable ? (Disposable)sdk : app;
|
||||
VirtualFileManager.getInstance().addAsyncFileListener(new AsyncFileListener() {
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -542,6 +544,6 @@ public class PyPackageUtil {
|
||||
// No continuation in write action is needed
|
||||
return null;
|
||||
}
|
||||
}, app);
|
||||
}, disposable);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user