Add missing Dispose() calls (#1552)

This commit is contained in:
Brian Pursley
2024-04-29 03:30:50 -04:00
committed by GitHub
parent 07a59e7e59
commit b50aed2654

View File

@@ -209,6 +209,7 @@ namespace k8s
// Dispose the client // Dispose the client
HttpClient?.Dispose(); HttpClient?.Dispose();
HttpClient = null;
// Dispose the certificates // Dispose the certificates
if (CaCerts is not null) if (CaCerts is not null)
@@ -221,11 +222,13 @@ namespace k8s
CaCerts.Clear(); CaCerts.Clear();
} }
ClientCert?.Dispose(); ClientCert?.Dispose();
ClientCert = null;
HttpClient = null; FirstMessageHandler?.Dispose();
FirstMessageHandler = null; FirstMessageHandler = null;
HttpClientHandler?.Dispose();
HttpClientHandler = null; HttpClientHandler = null;
} }
} }