Skip to content

Commit

Permalink
fix: dispose cached certificates when relevant flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ArachisH committed Apr 7, 2024
1 parent b163fb0 commit dbb484b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Eavesdrop/Certificates/CertificateProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,12 @@ private void Dispose(bool disposing)
}
TrustedRootCA?.Dispose();

foreach (X509Certificate2 cachedCertificate in _issuedCertificates.Values)
if (IsDisposingCachedCertificates)
{
cachedCertificate.Dispose();
foreach (X509Certificate2 cachedCertificate in _issuedCertificates.Values)
{
cachedCertificate.Dispose();
}
}
_issuedCertificates.Clear();
}
Expand Down

0 comments on commit dbb484b

Please sign in to comment.