Closes the given widgets and handles cases where the widget has been
        clone or is a clone of another widget
163127
def _close_widget(widget):
        
        if widget is None:
            return
        try:
            widget.document().setParent(None)
            widget.syntax_highlighter.setParent(None)
        except AttributeError:
            pass  # not a QPlainTextEdit subclass
        # handled cloned widgets
        clones = []
        if hasattr(widget, 'original') and widget.original:
            # cloned widget needs to be removed from the original
            widget.original.clones.remove(widget)
            try:
                widget.setDocument(None)
            except AttributeError:
                # not a QTextEdit/QPlainTextEdit
                pass
        elif hasattr(widget, 'clones'):
            clones = widget.clones
        try:
            # only clear current editor if it does not have any other clones
            widget.close(clear=len(clones) == 0)
        except (AttributeError, TypeError):
            # not a CodeEdit
            widget.close()
        return clones
111513
def closeView(self, view=None):
        
        if type(view) == int:
            view = self.widget(view)
        elif view == None:
            view = self.currentView()
        
        index = self.indexOf(view)
        if index == -1:
            return False
        
        # close the view
        count = self.count()
        if count == 1:
            self.closePanel()
        else:
            view.close()

        return True
459237
public void cleanUp() {
    // Removing the entries from widgets.dat suffices. Opera will remove the other files.
    // These other files are:
    // widgets/xxx.oex
    // widgets/OEX_PATH_PREFIX/
    if (backupWidgetDat != null) {
      try {
        Files.move(backupWidgetDat, widgetsDat);
      } catch (IOException e) {
        throw new WebDriverException("Unable to restore widgets.dat");
      }
    } else {
      widgetsDat.delete();
    }
  }
109478
@Override
	public void close() {
		IOUtils.closeQuietly(defaultColumnFamilyHandle);
		IOUtils.closeQuietly(nativeMetricMonitor);
		IOUtils.closeQuietly(db);
		// Making sure the already created column family options will be closed
		columnFamilyDescriptors.forEach((cfd) -> IOUtils.closeQuietly(cfd.getOptions()));
	}
476199
protected function _saveAppWidgets(): void
    {
        $widgets = $this->_getAppWidgets();

        $found = [];
        foreach ($widgets as $widget) {
            $found[] = $widget['name'];

            // skip adding existing app widgets
            if ($this->exists(['AppWidgets.name' => $widget['name']])) {
                continue;
            }

            $entity = $this->newEntity();
            $entity = $this->patchEntity($entity, $widget);
            $this->save($entity);
        }

        // soft delete non-existing app widgets
        $this->trashAll(! empty($found) ? ['AppWidgets.name NOT IN' => $found] : []);
    }
1065031
def _closeCompletion(self):
        
        if self._widget is not None:
            self._widget.close()
            self._widget = None
            self._completionOpenedManually = False
141849
def clear(self):
        
        for i in range(self.count() - 1, -1, -1):
            w = self.widget(i)
            if w:
                self.removeWidget(w)
                w.close()
                w.deleteLater()
1339512
def destroy(self):
        
        widget = self.widget
        if widget is not None:
            parent = self.parent_widget()
            if parent is not None:
                parent.removeView(widget)
            del self.widget
        super(AndroidToolkitObject, self).destroy()
665563
protected final void close() {
		if (SwingUtilities.isEventDispatchThread()) {
			closeIntern();
		} else {
			try {
				SwingUtilities.invokeAndWait(new Runnable() {
					public void run() {
						closeIntern();
					}
				});
			} catch (final Exception ex) {
				ignore();
			}
		}
	}
263110
public void close()
  {
    StreamSource ss = _indirectSource;
    _indirectSource = null;
    
    if (ss != null) {
      ss.freeUseCount();
    }
    else {
      freeUseCount();
    }
  }
622100
public void close() {
        if (mIsVisible) {
            mIsVisible = false;
            ((ViewGroup) mView.getParent()).removeView(mView);
            onClose();
        }
    }
927231
def remove(self, widget):
        """"""
        for i, (wid, _) in enumerate(self._widgets):
            if widget is wid:
                del self._widgets[i]
                return True

        raise ValueError('Widget not in list')
468772
def close(self):
        
        if hasattr(self, 'iterators'):
            for it in self.iterators:
                if hasattr(it, 'close'):
                    it.close()
1354297
@Override
  public void close()
  {
    super.close();
    facts.clear();
    indexAndOffsets.clear();

    if (selectors != null) {
      selectors.clear();
    }

    Closer c = Closer.create();
    aggBuffers.forEach(c::register);
    try {
      c.close();
    }
    catch (IOException e) {
      throw new RuntimeException(e);
    }
    aggBuffers.clear();
  }
527746
def destroy(self):
        
        widget = self.widget
        if widget is not None:
            widget.removeFromSuperview()
        super(UiKitView, self).destroy()
859553
synchronized
  public
  void close() {
    closed = true;
    if (sqw != null) {
        try {
            if (layoutHeaderChecked && layout != null && layout.getFooter() != null) {
                sendLayoutMessage(layout.getFooter());
            }
            sqw.close();
            sqw = null;
        } catch(java.io.IOException ex) {
            sqw = null;
        }
    }
  }
1145282
public void close()
    {
        inputManager.unregisterInputDeviceListener(inputDeviceListener);
        mouseDeviceManager.forceStopThread();
        gamepadDeviceManager.forceStopThread();
        controllerIds.clear();
        cache.clear();
        controllers.clear();
    }