From c3822b795cfecc5c45b8935da10506c0a5023a95 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 9 May 2018 20:02:51 +0100 Subject: [PATCH] CommandReader: use PTHREADS_INHERIT_NONE probably not necessary to register autoloader, but just in case... --- src/pocketmine/Server.php | 2 +- src/pocketmine/command/CommandReader.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index c209d6d5b..47d28f75e 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1434,7 +1434,7 @@ class Server{ $this->tickSleeper->addNotifier($consoleNotifier, function() : void{ $this->checkConsole(); }); - $this->console->start(); + $this->console->start(PTHREADS_INHERIT_NONE); $version = new VersionString($this->getPocketMineVersion()); diff --git a/src/pocketmine/command/CommandReader.php b/src/pocketmine/command/CommandReader.php index 34d709435..84e3261da 100644 --- a/src/pocketmine/command/CommandReader.php +++ b/src/pocketmine/command/CommandReader.php @@ -49,6 +49,8 @@ class CommandReader extends Thread{ if(extension_loaded("readline") and !isset($opts["disable-readline"]) and !$this->isPipe(STDIN)){ $this->type = self::TYPE_READLINE; } + + $this->setClassLoader(); } public function shutdown(){ @@ -168,6 +170,8 @@ class CommandReader extends Thread{ } public function run(){ + $this->registerClassLoader(); + if($this->type !== self::TYPE_READLINE){ $this->initStdin(); }