title: Do I need to dispose transient disposable objects?
body: <p>I have a class that creates several IDisposable objects, all of these objects are then passed to another 'manager' class in a 3rd party library. As I need some of the objects in later calls I kept a local field reference to the created objects so that I could access them at a later time. When I ran FxCop on the class it said that I should implement IDisposable, due to the disposable objects that I kept a reference to. My questions are:</p>
  <ol>
  <li>Should I implement IDisposable for my class? (or is it the manager's responsibility?)</li>
  <li>If so, should I only dispose the objects I kept a reference to? or should I find a way to dispose all objects I created.</li>
  </ol>
  <h3>My code:</h3>
  <pre><code>public class MyClass  
  {  
      ClassThatIsDisposable aReference;  
  }
  
  public MyClass(ManagerClass manager)  
  {  
      ClassThatIsDisposable transient=new ClassThatIsDisposable();  
      manager.Add(transient);  
      aReference=new ClassThatIsDisposable();  
      manager.Add(aReference);  
  }
  
  public void LaterCall()  
  {  
      areference.Method();  
  }  
    
  </code></pre>