Cleanup all child processes.
@private
174210
function bindExit() {
  if (exitBound)
    return;

  exitBound = true;

  listenExit(() => {
    for (const child of children)
      child.destroy();
  });
}
663288
def cleanup_environment():
    
    SERV.terminate()
    shutil.rmtree(TMP_PATH)
    if os.path.exists(TMP_PATH):
        os.rmdir(TMP_PATH)

    global TMP_PATH
    TMP_PATH = None
1221204
def clean_process_tree(*signal_handler_args):
    """"""
    parent = psutil.Process()
    procs = parent.children(recursive=True)
    if procs:
        print(f"[ZProc] Cleaning up {parent.name()!r} ({os.getpid()})...")

    for p in procs:
        with suppress(psutil.NoSuchProcess):
            p.terminate()
    _, alive = psutil.wait_procs(procs, timeout=0.5)  # 0.5 seems to work
    for p in alive:
        with suppress(psutil.NoSuchProcess):
            p.kill()

    try:
        signum = signal_handler_args[0]
    except IndexError:
        pass
    else:
        os._exit(signum)
774050
function() {
    // Cleans all cache files
    if (fs.existsSync(this.dir)) {
      var files = fs.readdirSync(this.dir);

      files.forEach(function(file) {
        fs.unlinkSync(path.join(this.dir, file));
      }.bind(this));
    }
  }
443861
protected function cleanup()
    {
        $this->filesystem->remove($this->tmpFolder);
        $this->root = null;
        $this->urlsets = array();
    }
517545
def cleanup(self):
        '''  '''
        self._processing_stop = True
        self._wakeup_processing_thread()
        self._processing_stopped_event.wait(3)
1227059
def cleanup():
    
    script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
    script_dir = os.path.realpath(os.path.join(script_dir, ".."))
    shutil.rmtree(os.path.join(script_dir, "dist"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "tmp"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh", "tmp"), ignore_errors=True)
1022434
function cleanupFiles(workingDir, zipFileName, callback) {
  // Force rm to be quite. Using exec is ok since no large stdout is to
  // be expected.
  var command = "rm -rf " + workingDir + " " + zipFileName;
  exec(command, function(err) {
    if (callback) {
      callback(err);
    }
  });
}
245705
def remove_all(self):
        ''''''
        if self._children:
            for child in self._children:
                if isinstance(child, String):
                    child._parent = None
            self._children = []
1325881
def cleanup_subprocesses():
    """"""
    # pylint: disable=redefined-outer-name, reimported
    # atexit functions tends to loose global imports sometimes so reimport
    # everything what is needed again here:
    import os
    import errno
    from mirakuru.base_env import processes_with_env
    from mirakuru.compat import SIGKILL

    pids = processes_with_env(ENV_UUID, str(os.getpid()))
    for pid in pids:
        try:
            os.kill(pid, SIGKILL)
        except OSError as err:
            if err.errno != errno.ESRCH:
                print("Can not kill the", pid, "leaked process", err)
325388
public function cleanup()
    {
        $this->cleaned = true;
        $this->remoteMethods = [];
        $this->localMethods = [];
        $this->persistentCallbacks = [];
        $this->callbacks = [];
    }
81991
function clean(globs) {
    globs = chek_1.toArray(globs);
    globs.forEach(function (g) {
        try {
            del.sync(g);
            // Some files may not exist del doesn't throw
            // error just continues.
            // log.notify(`successfully cleaned or ignored ${getRelative(g)}.`);
        }
        catch (ex) {
            logger_1.log.notify("failed to clean " + getRelative(g) + ".");
        }
    });
}
1192984
function _cleanUpTOCChildren(node) {

  if (!Array.isArray(node.children)) {
    return node;
  }

  if (_isExampleOrParameterLink(node)) {
    return null;
  }

  const filteredChildren = node.children.reduce((accu, nd) => {
    accu.push(_cleanUpTOCChildren(nd));
    return accu;
  }, []).filter(n => n);

  if (!filteredChildren.length) {
    return null;
  }

  return {
    ...node,
    children: filteredChildren
  };
}
634324
function(tasksPerProcess) {
  this.ttl = tasksPerProcess;
  this.available = true;

  this.process = fork(__dirname + '/child-process.js', {silent: true});

  this.reset = function() {
    this.process.kill('SIGKILL');
    this.process = fork(__dirname + '/child-process.js', {silent: true});
    this.ttl = tasksPerProcess;
    this.available = true;
  };

  this.clean = function() {
    this.process.removeAllListeners();
    this.process.stdout.removeAllListeners();
    this.process.stderr.removeAllListeners();
  };

  this.terminate = function() {
    this.process.kill('SIGTERM');
  };
}
184189
function () {
    if (processes && processes.length > 0) {
        for (var i = processes.length - 1; i >= 0; i--) {
            processes[i].kill();
        }
    }
}
743900
function cleanup() {
            // Need to do this in order to trigger the corresponding CloseLiveBrowser cleanups required on
            // the native Mac side
            var closeDeferred = (brackets.platform === "mac") ? NativeApp.closeLiveBrowser() : $.Deferred().resolve();
            closeDeferred.done(function () {
                _setStatus(STATUS_INACTIVE, reason || "explicit_close");
                // clean-up registered servers
                _regServers.forEach(function (server) {
                    LiveDevServerManager.removeServer(server);
                });
                _regServers = [];
                _closeDeferred.resolve();
            }).fail(function (err) {
                if (err) {
                    reason +=  " (" + err + ")";
                }
                _setStatus(STATUS_INACTIVE, reason || "explicit_close");
                _closeDeferred.resolve();
            });
        }
958339
def cleanup():
    """"""
    for sck in list(Wdb._sockets):
        try:
            sck.close()
        except Exception:
            log.warn('Error in cleanup', exc_info=True)