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:
authortherzok <marius.ungureanu@xamarin.com>2018-04-16 20:10:13 +0300
committerMarius Ungureanu <teromario@yahoo.com>2018-04-17 14:13:26 +0300
commit42fe3c347eaf90f763e76d0c4273efc19f20696d (patch)
tree9830aa8cb9adff946e0b64ccd55d3802042152f5 /main/src/core
parent3122a0f6504655d9ec164416a902861151a6b869 (diff)
Dispose old project instance later on
Diffstat (limited to 'main/src/core')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs
index 73ddbe648a..2fa5d0b781 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectInstance.cs
@@ -84,8 +84,10 @@ namespace MonoDevelop.Projects.MSBuild
public void Evaluate ()
{
- if (projectInstance != null)
- engine.DisposeProjectInstance (projectInstance);
+ object oldProjectInstance = null;
+ if (projectInstance != null) {
+ oldProjectInstance = projectInstance;
+ }
info = msproject.LoadNativeInstance (!OnlyEvaluateProperties);
@@ -110,6 +112,9 @@ namespace MonoDevelop.Projects.MSBuild
// If the project can't be evaluated don't crash
LoggingService.LogError ("MSBuild project could not be evaluated", ex);
throw new ProjectEvaluationException (msproject, ex.Message);
+ } finally {
+ if (oldProjectInstance != null)
+ engine.DisposeProjectInstance (oldProjectInstance);
}
}