Language (C#)
Manually call Dispose
If an object implements the IDiposable interface, it is, usually, a good practice to manually call its Dispose method as soon as the application does not need that object anymore. There are two main ways to do this:
- explicitly - Actually call the
Disposemethod. Most suggested in a try-finally block. - implicitly - Use a
usingblock or ausingdeclaration.
- Is there a functional difference between the
usingblock, theusingdeclaration and atry-finallyblock?
If you like my work and want to support me, you can buy me a coffee: