code: public void detach() {
          if (listener != null) {
              contextFactory.removeListener(listener);
              contextFactory = null;
              listener = null;
          }
      }
docs: Detaches the debugger from the current ContextFactory.