terminateProcess method

bool terminateProcess(
  1. int pid
)

Terminates a running Minecraft process.

pid - Process identifier to terminate Returns true if the process was successfully terminated, false otherwise.

Implementation

bool terminateProcess(int pid) {
  final processInfo = _runningProcesses[pid];
  if (processInfo != null) {
    try {
      processInfo.process.kill();
      return true;
    } catch (e) {
      debugPrint('Error terminating process $pid: $e');
      return false;
    }
  }
  return false;
}