title: What does Process.Dispose() actually do?
body: <p>In C# <code>class Process</code> inherits from <code>class Component</code> that implements <code>IDisposable</code> and so I can call <code>Dispose()</code> on any <code>Process</code> object. Do I really have to? How do I know if I really have to?</p>
  
  <p>Suppose I have the following code:</p>
  
  <pre><code> var allProcesses = System.Diagnostics.Process.GetProcesses();
   var processesNames = processes.Select( p =&gt; p.ProcessName );
   // output process names here
  </code></pre>
  
  <p>Now it looks like I have an array of <code>Process</code> objects and I have craft a <code>try-finally</code> to traverse the array and <code>Dispose()</code> each object. That's definitely lots of extra code.</p>
  
  <p>What does that <code>Dispose()</code> do for <code>Process</code> objects? Do I really need to <code>Dispose()</code> every <code>Process</code> object and how do I decide if I need to do so?</p>