Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Karlaš <david.karlas@xamarin.com>2017-03-16 15:52:55 +0300
committerDavid Karlaš <david.karlas@xamarin.com>2017-03-16 15:53:29 +0300
commita3ac006704c9b07187b1823d8d5fb3c473b90b0f (patch)
tree8667f3185ecc8ca49d9ebe171901da36a575c1cb /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem
parenta549066cd36b2f5b2345ea8804eb406683a19e2f (diff)
Bug 51614 - Document is not part of the workspace exception
While trying to reproduce and verify bug fix from fc37fbf I found few more issues
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
index b9181c019b..03e197a5d4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs
@@ -775,6 +775,15 @@ namespace MonoDevelop.Ide.TypeSystem
internal void InformDocumentClose (DocumentId analysisDocument, string filePath)
{
try {
+ lock (openDocuments) {
+ var openDoc = openDocuments.FirstOrDefault (d => d.Id == analysisDocument);
+ if (openDoc != null) {
+ openDoc.Dispose ();
+ openDocuments.Remove (openDoc);
+ }
+ }
+ if (!CurrentSolution.ContainsDocument (analysisDocument))
+ return;
var loader = new MonoDevelopTextLoader (filePath);
var document = this.GetDocument (analysisDocument);
var openDocument = this.openDocuments.FirstOrDefault (w => w.Id == analysisDocument);