Re: X509Certificate2, X509Store and resource management

Peter Ritchie <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <LISTSERV%[email protected]>
Considering X509Certificate2 has an SafeCertContextHandle member and X509Store has a SafeCertStoreHandler member (which are both a type of SafeHandle) they *should* implement IDisposable.

As to why they don't, it's anyones guess.  Probably just an oversight.

You can call the X509Certificate2.Reset method to manually dispose of the SafeCertContextHandle and release resources; and call X509Store.Close to manually dispose of the SafeCertStoreHandle and release resources.

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.