Perform session cleanup, since the end method should always be
        called explicitely by the calling code, this works better than the
        destructor.
        Set close_fileobj to False so fileobj can be returned open.
199
def end(self, close_fileobj=True):
        """"""
        log.debug("in TftpContext.end - closing socket")
        self.sock.close()
        if close_fileobj and self.fileobj is not None and not self.fileobj.closed:
            log.debug("self.fileobj is open - closing")
            self.fileobj.close()
1195901
private void closeFileObject(String typeName, FileObject fileObject) {
        /*
         * If typeName is non-null, the file object was opened as a
         * source or class file by the user.  If a file was opened as
         * a resource, typeName will be null and the file is *not*
         * subject to annotation processing.
         */
        if ((typeName != null)) {
            if (!(fileObject instanceof JavaFileObject))
                throw new AssertionError("JavaFileOject not found for " + fileObject);
            JavaFileObject javaFileObject = (JavaFileObject)fileObject;
            switch(javaFileObject.getKind()) {
            case SOURCE:
                generatedSourceNames.add(typeName);
                generatedSourceFileObjects.add(javaFileObject);
                openTypeNames.remove(typeName);
                break;

            case CLASS:
                generatedClasses.put(typeName, javaFileObject);
                openTypeNames.remove(typeName);
                break;

            default:
                break;
            }
        }
    }
988677
def finalize_file(self):
        # type: (Descriptor) -> None
        
        # delete bad file if integrity failed
        if self._integrity_failed:
            self.final_path.unlink()
        else:
            self._restore_file_attributes()
            self._restore_file_lmt()
        # update resume file
        self._update_resume_for_completed()
        with self._meta_lock:
            self._finalized = True
784484
@Override
	public void close() {
		synchronized (this) {
			if (object != null) {
				T object_ = object;
				object = null;
				try {
					finalizer.accept(object_);
				} catch (Exception e) {
					// Ignored
				}
			}
		}
	}
1255052
def close(self):
        
        if self._closed:
            return
        self._closed = True
        self._writer.endElementNS((namespaces.xmlstream, "stream"), None)
        for prefix in self._nsmap_to_use:
            self._writer.endPrefixMapping(prefix)
        self._writer.endDocument()
        del self._writer
866737
@Override
  public void close() {
    if (!isClosed()) {
      closed = true;
      // With the current code we don't expect readableBytes > 0 to be possible here, added
      // defensively to prevent buffer leak issues if the framer code changes later.
      if (buffer != null && buffer.readableBytes() == 0) {
        releaseBuffer();
      }
      commitToSink(true, true);
    }
  }
1216703
def close(self):
        '''
        
        '''
        if self._closing:
            return
        self._closing = True
        for stream in self.streams:
            stream.close()
        self.streams.clear()
        if hasattr(self.sock, 'close'):
            self.sock.close()
1236709
def _Close(self):
    
    self._tar_file.close()
    self._tar_file = None

    self._file_object.close()
    self._file_object = None
993555
void closeImpl()
  {
    ReadStreamOld is = _is;
    _is = null;

    WriteStreamOld os = _os;
    _os = null;

    try {
      if (is != null)
        is.close();
    } catch (Throwable e) {
      log.log(Level.FINER, e.toString(), e);
    }

    try {
      if (os != null)
        os.close();
    } catch (Throwable e) {
      log.log(Level.FINER, e.toString(), e);
    }

    if (is != null) {
      _connProbe.end();

      if (_requestStartTime > 0)
        _requestTimeProbe.end(_requestStartTime);

      if (_isIdle)
        _idleProbe.end();
    }
  }
356424
def _Close(self):
    
    self._zip_file.close()
    self._zip_file = None

    self._file_object.close()
    self._file_object = None
63897
def session_end(self):
        
        self.session_depth -= 1
        self.session_depth = max(0, self.session_depth)
        if self.session_depth == 0:
            self._session_end()
805656
def cleanup(self):
        
        if getattr(self._finalizer, "detach", None) and self._finalizer.detach():
            if os.path.exists(self.path):
                try:
                    rmtree(self.path)
                except OSError:
                    pass
                else:
                    self.path = None
427297
def _Close(self):
    
    if not self._file_object_set_in_init:
      try:
        # TODO: fix close being called for the same object multiple times.
        self._file_object.close()
      except IOError:
        pass
      self._file_object = None
1017693
def _Close(self):
    
    self._bde_volume.close()
    self._bde_volume = None

    self._file_object.close()
    self._file_object = None
213883
function close_object() {
    $this->_pdf->restore();
    $this->_pdf->end_template();
    $this->_pdf->resume_page("pagenumber=".$this->_page_number);
  }
494931
def on_close(self):
        '''
        
        '''

        if self.id in self.funcserver.websocks:
            self.funcserver.websocks[self.id] = None
            ioloop = tornado.ioloop.IOLoop.instance()
            ioloop.add_callback(lambda: self.funcserver.websocks.pop(self.id, None))

        psession = self.funcserver.pysessions.get(self.pysession_id, None)
        if psession:
            psession['socks'].remove(self.id)
            if not psession['socks']:
                del self.funcserver.pysessions[self.pysession_id]
1241114
boolean _close()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "_close");

    boolean closedNow = false;

    synchronized (this)
    {
      if (!_closed)
      {
        _closed = true;
        closedNow = true;
      }
    }

    if (closedNow)
    {
      /*
       * This must be done outside the synchronization as it will synchronize on
       * the set of producer sessions whilst detaching this producer and if not
       * done outside, this could cause a deadlock with methods that synchronize
       * on the set and then each producersession in the set in turn.
       */
      _inputHandler.detachProducer(this);
      _inputHandler = null;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "_close", new Boolean(closedNow));

    return closedNow;
  }