diff --git a/PocketMine-MP.php b/PocketMine-MP.php index 521ad8eae..09b9fea55 100644 --- a/PocketMine-MP.php +++ b/PocketMine-MP.php @@ -35,5 +35,4 @@ require_once(FILE_PATH."/src/dependencies.php"); $server = new ServerAPI(); $server->run(); - -kill(getmypid()); //Fix for segfault +exit(0); \ No newline at end of file diff --git a/src/API/ConsoleAPI.php b/src/API/ConsoleAPI.php index 9b4ed8c83..7f06e377c 100644 --- a/src/API/ConsoleAPI.php +++ b/src/API/ConsoleAPI.php @@ -209,7 +209,8 @@ class ConsoleAPI{ } class ConsoleLoop extends Thread{ - public $line, $stop; + public $line; + public $stop; public function __construct(){ $this->line = false; $this->stop = false; diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index d850289a8..a3d6e698d 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -315,7 +315,6 @@ class ServerAPI{ $this->server->init(); unregister_tick_function(array($this->server, "tick")); $this->__destruct(); - unset($this->server); if($this->getProperty("upnp-forwarding") === true ){ console("[INFO] [UPnP] Removing port forward..."); UPnP_RemovePortForward($this->getProperty("port")); diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index 0a465b339..845ce711c 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -462,6 +462,9 @@ class PocketMinecraftServer{ } public function dumpError(){ + if($this->stop === true){ + return; + } console("[ERROR] An Unrecovereable has ocurred and the server has Crashed. Creating an Error Dump"); $dump = "# PocketMine-MP Error Dump ".date("D M j H:i:s T Y")."\r\n"; $er = error_get_last(); diff --git a/src/functions.php b/src/functions.php index b6420dbbf..b342d7be8 100644 --- a/src/functions.php +++ b/src/functions.php @@ -25,25 +25,6 @@ the Free Software Foundation, either version 3 of the License, or */ - - -function kill($pid){ - switch(Utils::getOS()){ - case "win": - ob_start(); - passthru("%WINDIR%\\System32\\taskkill.exe /F /PID ".((int) $pid)); - ob_end_clean(); - break; - case "mac": - case "linux": - default: - ob_start(); - passthru("kill -9 ".((int) $pid)); - ob_end_clean(); - } -} - - function require_all($path, &$count = 0){ $dir = dir($path."/"); $dirs = array();