I think the question says it all.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They should implement
IDisposableif the object owns that resource. There’s generally no need to set things to null, although it does no harm.If you don’t own the resource, then clearly you shouldn’t dispose of it, and you don’t need to implement
IDisposable. In my experience it’s relatively rare that I have a member variable for a disposable resource which I don’t own in my classes though…