private static void removeLocator(InternalLocator locator) {
    if (locator == null) {
      return;
    }
    synchronized (locatorLock) {
      if (locator.loggingSession.getState() != InternalSessionContext.State.STOPPED) {
        locator.loggingSession.stopSession();
        locator.loggingSession.shutdown();
      }
      if (locator.equals(InternalLocator.locator)) {
        InternalLocator.locator = null;
      }
    }
  }
The cache owned by this locator, if any. Note that if a cache already exists because the
locator is being colocated in a normal member this field will be null.
geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java