Set the device down and delete the bridge.
969284
def delbr(self, name):
        
        self.getbr(name) # Check if exists
        _runshell([ipexe, 'link', 'set', 'dev', name, 'down'],
            "Could not set link down for %s." % name)
        _runshell([brctlexe, 'delbr', name],
            "Could not delete bridge %s." % name)
945107
private void remove(PollController conn)
  {
    if (conn == null) {
      return;
    }

    JniSocketImpl socket = (JniSocketImpl) conn.getSocket();
    int nativeFd = socket.getNativeFd();

    if (_lifecycle.isDestroyed()) {
      return;
    }

    _activeCount.incrementAndGet();

    if (nativeFd > 0) {
      try {
        removeNative(_fd, nativeFd);
      } catch (Throwable e) {
        log.log(Level.WARNING, e.toString(), e);
        _lifecycle.toError();
      }
    }
    
    conn.toKeepaliveClose();

    if (_activeCount.decrementAndGet() == 0 && _lifecycle.isDestroyed()) {
      destroy();
    }
  }
915341
public synchronized void stop() {
        if (mConnectThread != null) {
            mConnectThread.cancel();
            mConnectThread = null;
        }

        if (mConnectedThread != null) {
            mConnectedThread.cancel();
            mConnectedThread = null;
        }

        if (mSecureAcceptThread != null) {
            mSecureAcceptThread.cancel();
            mSecureAcceptThread.kill();
            mSecureAcceptThread = null;
        }
        setState(BluetoothService.STATE_NONE);
    }
1003476
function remove() {
    primus.removeListener('error', remove)
          .removeListener('open', remove)
          .removeListener('end', remove)
          .timers.clear('connect');
  }
295083
def close(self):
        
        if self._is_open:
            self._is_open = False
            hidapi.hid_close(self._device)
976344
def off(self):
        """"""
        msg = X10Send.unit_code_msg(self.address.x10_housecode,
                                    self.address.x10_unitcode)
        self._send_method(msg)

        msg = X10Send.command_msg(self.address.x10_housecode,
                                  X10_COMMAND_OFF)
        self._send_method(msg, False)
        self._update_subscribers(0x00)
864031
def close(self):
        
        if self._protocol is not None:
            self._protocol.processor.close()
            del self._protocol
1009563
function destroy () {
    if (this.connection.destroy) {
      this.connection.destroy()
    } else if (this.connected) {
      this.connection.disconnect('destroy')
    }
    for (var i = 0; i < this.unbind.length; i++) {
      this.unbind[i]()
    }
    clearTimeout(this.pingTimeout)
    this.endTimeout()
  }
789517
public void onDestroy() {
    stopNavigation();
    removeOffRouteListener(null);
    removeProgressChangeListener(null);
    removeMilestoneEventListener(null);
    removeNavigationEventListener(null);
    removeFasterRouteListener(null);
    removeRawLocationListener(null);
  }
231626
def remove_device(self, path):
        ""
        if self.__get_control_socket():
            self.sock.sendall("-%s\r\n\x00" % path)
            self.sock.recv(12)
            self.sock.close()
1324539
def end_script(self):
        """"""

        if self.remote_bridge.status not in (BRIDGE_STATUS.RECEIVED, BRIDGE_STATUS.WAITING):
            return [1] #FIXME: State change

        self.remote_bridge.status = BRIDGE_STATUS.RECEIVED
        return [0]
715423
def close(self):
        """"""

        if hasattr(self, "conn"):
            self.conn.close()
            del self.conn
        if hasattr(self, "user"):
            del self.user
98035
def set_off(self):
        """"""
        try:
            request = requests.post(
                '{}/{}/{}/'.format(self.resource, URI, self._mac),
                data={'action': 'off'}, timeout=self.timeout)
            if request.status_code == 200:
                pass
        except requests.exceptions.ConnectionError:
            raise exceptions.MyStromConnectionError()
1268880
def stop(self):
        """"""
        self.logger.warning("Stop executed")
        try:
            self._reader.close()
        except serial.serialutil.SerialException:
            self.logger.error("Error while closing device")
            raise VelbusException("Error while closing device")
        time.sleep(1)
354318
def close(self):
        """"""
        if self._local.conn:
            self._local.conn.transport.close()
        self._local.conn = None
682744
private function destroyClient(): void
    {
        ++$this->reconnects;
        $this->client = null;
        $delay = mt_rand(0, (int)min(5000, (int)pow(2, $this->reconnects) * 100));
        usleep($delay * 1000);
    }
807582
def depart(self):
        
        unit = hookenv.remote_unit()
        self.units.remove(unit)
        if self.units:
            unitdata.kv().set(self.key, self.serialize(self))
        else:
            unitdata.kv().unset(self.key)