protected override void Dispose(bool disposing)
        {
            cluster?.Dispose();
            cluster = null;

            base.Dispose(disposing);
        }
Example #2
0
        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();
                    }
                }
            }
        }