diff --git a/snippets/VS2010/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n b/snippets/VS2010/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n index c82b255d78..7971837602 100644 --- a/snippets/VS2010/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n +++ b/snippets/VS2010/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Diagnostics; using System.Linq; @@ -52,7 +52,7 @@ namespace Nemerle.Completion2 public Close() : void { - AsyncWorker.AddWork(AsyncRequest(AsyncRequestType.CloseProject, this, null, _ => ())); + AsyncWorker.AddWork(AsyncRequest(AsyncRequestType.CloseProject, this, null, _ => CleanUpTypes())); } // HACK: see usings diff --git a/snippets/VS2010/Nemerle.VisualStudio/LanguageService/NemerleSource.cs b/snippets/VS2010/Nemerle.VisualStudio/LanguageService/NemerleSource.cs index ee38a6502d..dd0b1733af 100644 --- a/snippets/VS2010/Nemerle.VisualStudio/LanguageService/NemerleSource.cs +++ b/snippets/VS2010/Nemerle.VisualStudio/LanguageService/NemerleSource.cs @@ -596,10 +596,6 @@ public override ParseRequest BeginParse(int line, int idx, TokenInfo info, Parse public override void Dispose() { - SmartIndent = null; - MethodData = null; - _tipAsyncRequest = null; - if (ProjectInfo != null) { ProjectInfo.RemoveEditableSource(this); @@ -617,6 +613,22 @@ public override void Dispose() ProjectInfo = null; } + SmartIndent = null; + MethodData = null; + _tipAsyncRequest = null; + CompileUnit = null; + Declarations = null; + Service = null; + + if (_relocationRequestsQueue != null) + _relocationRequestsQueue.Clear(); + + if (TypeLocations != null) + TypeLocations.Clear(); + + if (MethodsTypeLocations != null) + MethodsTypeLocations.Clear(); + base.Dispose(); } diff --git a/snippets/VS2010/Nemerle.VisualStudio/Project/NemerleProjectNode.cs b/snippets/VS2010/Nemerle.VisualStudio/Project/NemerleProjectNode.cs index 0ec718ad02..611dfbddc8 100644 --- a/snippets/VS2010/Nemerle.VisualStudio/Project/NemerleProjectNode.cs +++ b/snippets/VS2010/Nemerle.VisualStudio/Project/NemerleProjectNode.cs @@ -757,7 +757,11 @@ protected override void Dispose(bool disposing) { if (!_suppressDispose) { - ProjectInfo.Close(); + if (_projectInfo != null) + { + _projectInfo.Close(); + _projectInfo = null; + } base.Dispose(disposing); } }