Yes you should. And you are right that this is not entirely obvious, usually you should use only Dispose objects created by you (using new
) and leave those that you get / occupy only from another component.
The key in the name and description of WebRequest.Create()
is the factory method that creates something on your behalf, and the caller (you) is responsible for the return value.
And, of course, the using() {}
block is the preferred syntax.
source share