title: Does the C# compiler automatically dispose of IDisposable objects?
body: <p>Assuming I have a method <code>public static Rectangle DrawRectangle(Vector origin, Vector size)</code> which returns an object of type <code>Rectangle : IDisposable</code></p>
  
  <p>If I call only the method <code>DrawRectangle(origin, size)</code>, but do not assign the return value to a variable <code>myRectangle = DrawRectangle(origin, size)</code>, will the compiler automatically detect this and call <code>DrawRectangle(origin, size).Dispose()</code>, or do I have to do it myself?</p>