IDisposable and managed resources [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Proper use of the IDisposable interface I have a class that has both managed and unmanaged resources. I am using IDisposable to release un-managed resources. Should I release managed resources in the dispose method? Or I can leave it to GC to release managed resources? 回答1: If you have a look at the following documentation you will find the line: Free any disposable resources a type owns in its Dispose method.