code: public static void end()
      {
          ServiceContext context = (ServiceContext) _localContext.get();
  
          if (context != null && --context._count == 0) {
              context._request = null;
              context._response = null;
  
              context._headers.clear();
  
              _localContext.set(null);
          }
      }
docs: Cleanup at the end of a request.