I've read about disposing objects/IDisposable interface and destructors in C#, but to me they seem to do the same thing?
What is the difference between the two? Why would I use one over the other? In fact, in this example (link below) this code uses both the IDisposable interface and a destructor:
http://msdn.microsoft.com/en-us/library/system.idisposable.aspx
The comment says the destructor is if the finalization code is not used, but how do I decide when to use one over the other?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…