anchor.diff:      return _logger.run('Compute analysis result for $file', () {
         _LibraryContext libraryContext = _createLibraryContext(file);
         AnalysisContext analysisContext = _createAnalysisContext(libraryContext);
  -      analysisContext.setContents(file.source, file.content);
  -      // TODO(scheglov) Add support for parts.
  -      CompilationUnit resolvedUnit =
  -          analysisContext.resolveCompilationUnit2(file.source, file.source);
  -      List<AnalysisError> errors = analysisContext.computeErrors(file.source);
  -      return new AnalysisResult(file.path, file.uri, file.content,
  -          file.contentHash, resolvedUnit, errors);
  +      try {
  +        analysisContext.setContents(file.source, file.content);
  +        // TODO(scheglov) Add support for parts.
  +        CompilationUnit resolvedUnit =
  +            analysisContext.resolveCompilationUnit2(file.source, file.source);
  +        List<AnalysisError> errors = analysisContext.computeErrors(file.source);
  +        return new AnalysisResult(file.path, file.uri, file.content,
  +            file.contentHash, resolvedUnit, errors);
  +      } finally {
  +        analysisContext.dispose();
  +      }
       });
     }
   
  
positive.code:           // Append the defining unit.
            _ReferencedUris referenced;
            {
              PackageBundle bundle = _getUnlinked(libraryFile);
              UnlinkedUnit unlinked = bundle.unlinkedUnits.single;
              referenced = new _ReferencedUris(unlinked);
              node.unlinkedBundles.add(bundle);
  
negative.code:       for (String path in _filesToVerifyUnlinkedSignature) {
          _File file = _fileForPath(path);
          // Get the existing old API signature, maybe null.
          String oldSignature = file.currentUnlinked?.apiSignature;
          // Clear the content hash cache, so force the file reading.
          _fileContentHashMap.remove(path);
          // Compute the new API signature.
          String newSignature = file.unlinked.apiSignature;
          // If the signatures are not the same, then potentially every linked
          // library is inconsistent and should be recomputed, and every explicit
          // file has inconsistent analysis results which also should be recomputed.
  