MonoDevelop.Projects.MSBuild.RemoteBuildEngine.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
		public void Dispose ()
		{
			Interlocked.Decrement (ref count);
			try {
				alive = false;
				if (proc != null) {
					try {
						proc.Kill ();
					} catch {
					}
				}
				else
					engine.Dispose ();
			} catch {
				// Ignore
			}
		}

Usage Example

Example #1
0
 static Task ReleaseProjectBuilderNoLock(RemoteBuildEngine engine)
 {
     if (--engine.ReferenceCount != 0)
     {
         return(Task.CompletedTask);
     }
     if (engine.IsShuttingDown)
     {
         // If the engine is being shut down, dispose it now.
         builders.Remove(engine);
         engine.Dispose();
     }
     else
     {
         // Wait a bit before disposing the engine. We may need to use it again.
         engine.ScheduleForDisposal(EngineDisposalDelay).ContinueWith(async t => {
             using (await buildersLock.EnterAsync().ConfigureAwait(false)) {
                 // If this is the last standing build engine for the solution, don't dispose it.
                 // In this way there will always be at least one build engine for each solution,
                 // until explicitly unloaded.
                 if (!builders.GetAllBuilders().Where(b => !b.IsShuttingDown && b != engine && b.SolutionFile == engine.SolutionFile).Any())
                 {
                     return;
                 }
                 // If after the wait there are still 0 references, dispose the builder
                 if (engine.ReferenceCount == 0)
                 {
                     builders.Remove(engine);
                     engine.Dispose();
                 }
             }
         }, TaskContinuationOptions.NotOnCanceled);
     }
     return(Task.CompletedTask);
 }
All Usage Examples Of MonoDevelop.Projects.MSBuild.RemoteBuildEngine::Dispose