/// <inheritdoc/>
        protected virtual void Dispose(bool disposing)
        {
            if (isDisposed)
            {
                return;
            }

            if (disposing)
            {
                // free managed resources
                db.FlushDatabase();
                db.Multiplexer.GetSubscriber().UnsubscribeAll();
                connectionPoolManager.Dispose();
            }

            // free native resources if there are any.
            if (nativeResource != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(nativeResource);
                nativeResource = IntPtr.Zero;
            }

            isDisposed = true;
        }
 public void Dispose()
 {
     db.FlushDatabase();
     db.Multiplexer.GetSubscriber().UnsubscribeAll();
     connectionPoolManager.Dispose();
 }