@Override
  protected void cleanup() {
    // CqBaseRegion
    try {
      if (cqBaseRegion != null && !cqBaseRegion.isDestroyed()) {
        cqBaseRegion.getFilterProfile().closeCq(this);
        CacheClientProxy clientProxy = cacheClientNotifier.getClientProxy(clientProxyId);
        clientProxy.decCqCount();
        if (clientProxy.hasNoCq()) {
          cqService.stats().decClientsWithCqs();
        }
      }
    } catch (Exception ex) {
      // May be cache is being shutdown
      if (logger.isDebugEnabled()) {
        logger.debug("Failed to remove CQ from the base region. CqName :{}", cqName);
      }
    }
  }
Clears the resource used by CQ.
geode-cq/src/main/java/org/apache/geode/cache/query/cq/internal/ServerCQImpl.java