diff --git a/Build/debugpy-version.txt b/Build/debugpy-version.txt index d2c4b27150..8b315b3fed 100644 --- a/Build/debugpy-version.txt +++ b/Build/debugpy-version.txt @@ -1 +1 @@ -1.8.7 \ No newline at end of file +1.8.8 \ No newline at end of file diff --git a/Python/Product/PythonTools/PythonTools/Project/CondaEnvCreateInfoBar.cs b/Python/Product/PythonTools/PythonTools/Project/CondaEnvCreateInfoBar.cs index 5e2ac25784..1fcaceb838 100644 --- a/Python/Product/PythonTools/PythonTools/Project/CondaEnvCreateInfoBar.cs +++ b/Python/Product/PythonTools/PythonTools/Project/CondaEnvCreateInfoBar.cs @@ -129,6 +129,10 @@ public override async Task CheckAsync() { Context = InfoBarContexts.Project; MissingEnvName = null; + if (Project == null || Project.IsDisposed) { + return; + } + if (Project.GetProjectProperty(PythonConstants.SuppressEnvironmentCreationPrompt).IsTrue()) { return; } diff --git a/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs b/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs index 46c0c2b6cb..7fae7e30de 100644 --- a/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs +++ b/Python/Product/PythonTools/PythonTools/Project/PythonProjectNode.cs @@ -86,6 +86,7 @@ internal partial class PythonProjectNode : private bool _infoBarCheckTriggered = false; private bool _asyncInfoBarCheckTriggered = false; + private bool _isDisposed = false; private readonly CondaEnvCreateInfoBar _condaEnvCreateInfoBar; private readonly VirtualEnvCreateInfoBar _virtualEnvCreateInfoBar; private readonly PackageInstallInfoBar _packageInstallInfoBar; @@ -95,6 +96,8 @@ internal partial class PythonProjectNode : private readonly SemaphoreSlim _recreatingAnalyzer = new SemaphoreSlim(1); private bool _isRefreshingInterpreters = false; + public bool IsDisposed => _isDisposed; + public event EventHandler LanguageServerInterpreterChanged; public event EventHandler LanguageServerSearchPathsChanged; @@ -1035,6 +1038,12 @@ public void AddActionOnClose(object key, Action action) { } protected override void Dispose(bool disposing) { + if (_isDisposed) { + throw new ObjectDisposedException(nameof(PythonProjectNode)); + } + + _isDisposed = true; + if (disposing) { var actions = _actionsOnClose; _actionsOnClose = null; @@ -1082,7 +1091,6 @@ protected override void Dispose(bool disposing) { _recreatingAnalyzer.Dispose(); } - base.Dispose(disposing); } diff --git a/package.json b/package.json index ad6b46cae0..fe8b152145 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,6 @@ "name": "ptvs", "private": true, "devDependencies": { - "@pylance/pylance": "2024.10.1" + "@pylance/pylance": "2024.11.1" } }