protected override void Dispose(bool disposing) { cluster?.Dispose(); cluster = null; base.Dispose(disposing); }
protected override void Dispose(bool disposing) { lock (clusterLock) { if (sharedRefCount > 0) { Debug.Assert(sharedCluster != null); sharedRefCount--; if (sharedRefCount == 0) { sharedCluster?.Dispose(); sharedCluster = null; sharedServers.Dispose(); } } } }