If I keep initializing X509Store
certificate stores and don't use their Close()
method, what is the implication of this?
In the code example given in documentation, they don't use try..finally
block to make a call to Close
method. If this certificate store is something that needs to be freed, why does not the API of the class designed to derive from IDisposable
or why does not this class have a implicit destructor called when object goes out of scope?
In .NET 4.6, X509Store
was modified and now implementing IDisposable
.
The Dispose
implementation is calling the Close()
.
From Microsoft Docs:
Starting with the .NET Framework 4.6, this type implements the IDisposable interface. When you have finished using the type, you should dispose of it either directly or indirectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With