/** * The class destructor. * * Cleanly quits Octave, closes the pipes and the process. * @return void */ public function __destruct() { if (!is_resource($this->process)) { // Already dead return; } if ($this->hangingProcess) { $this->_closePipes(); return; } $this->_send("quit\n"); $this->_closePipes(); $status = proc_close($this->process); if ($status == -1) { throw new RuntimeException("Failed closing process"); } Octave_daemon::manageDeadPID($this->pid); }