From 37fd0372cc349a2cbac470399490339d8a68d834 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 6 Jan 2015 19:43:44 +0100 Subject: [PATCH] Added GarbageCollectionTask, workaround for weird PHP behaviour when using --disable-ansi --- src/pocketmine/Server.php | 3 ++ .../scheduler/GarbageCollectionTask.php | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/pocketmine/scheduler/GarbageCollectionTask.php diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 53f641b06..e246cdf4b 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -86,6 +86,7 @@ use pocketmine\plugin\PluginLoadOrder; use pocketmine\plugin\PluginManager; use pocketmine\scheduler\CallbackTask; +use pocketmine\scheduler\GarbageCollectionTask; use pocketmine\scheduler\SendUsageTask; use pocketmine\scheduler\ServerScheduler; use pocketmine\tile\Chest; @@ -1688,6 +1689,8 @@ public function __construct(\ClassLoader $autoloader, \ThreadedLogger $logger, $ $this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask([$this, "doLevelGC"]), $this->getProperty("chunk-gc.period-in-ticks", 600), $this->getProperty("chunk-gc.period-in-ticks", 600)); } + $this->scheduler->scheduleRepeatingTask(new GarbageCollectionTask(), 900); + $this->enablePlugins(PluginLoadOrder::POSTWORLD); $this->start(); diff --git a/src/pocketmine/scheduler/GarbageCollectionTask.php b/src/pocketmine/scheduler/GarbageCollectionTask.php new file mode 100644 index 000000000..f6b3e2d63 --- /dev/null +++ b/src/pocketmine/scheduler/GarbageCollectionTask.php @@ -0,0 +1,32 @@ +