C# – Implementing Finalize and Dispose to clean up resources

Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), database connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. To provide explicit control, implement the Dispose method provided by the IDisposable interface. The consumer of … Continue reading “C# – Implementing Finalize and Dispose to clean up resources”