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?
No comments:
Post a Comment