diff --git a/src/KubernetesClient/Kubernetes.cs b/src/KubernetesClient/Kubernetes.cs index 53783edc6..5e5021356 100644 --- a/src/KubernetesClient/Kubernetes.cs +++ b/src/KubernetesClient/Kubernetes.cs @@ -209,6 +209,7 @@ protected virtual void Dispose(bool disposing) // Dispose the client HttpClient?.Dispose(); + HttpClient = null; // Dispose the certificates if (CaCerts is not null) @@ -221,11 +222,13 @@ protected virtual void Dispose(bool disposing) CaCerts.Clear(); } - ClientCert?.Dispose(); + ClientCert = null; - HttpClient = null; + FirstMessageHandler?.Dispose(); FirstMessageHandler = null; + + HttpClientHandler?.Dispose(); HttpClientHandler = null; } }