Object dispose in IDisposable class

You have to implement IDisposable interface methods: public void Dispose() { // Clear all unmanaged resources } Whenever you then instantiate your object you should do it inside a using statement using(Program3 p3 = new Program3()) { //do your job } // here the p3.Dispose gets called It is important to note that the point … Read more