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
Dispose
method. Most suggested in a try-finally block. - implicitly - Use a
using
block or ausing
declaration.
- Is there a functional difference between the
using
block, theusing
declaration and atry-finally
block?
If you like my work and want to support me, you can buy me a coffee: