From 75fa2f1132bfbdd8f1945445360706704d05e77c Mon Sep 17 00:00:00 2001 From: SOFe Date: Sat, 12 Nov 2016 18:57:52 +0800 Subject: [PATCH] Fixed array progress crashing Forgot to serialize them. They would be converted to Volatile, which is Threaded. Threaded objects still crash with progressUpdates. --- src/pocketmine/scheduler/AsyncTask.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/scheduler/AsyncTask.php b/src/pocketmine/scheduler/AsyncTask.php index 4d2a48912..86d132387 100644 --- a/src/pocketmine/scheduler/AsyncTask.php +++ b/src/pocketmine/scheduler/AsyncTask.php @@ -178,7 +178,7 @@ abstract class AsyncTask extends Collectable{ * @param mixed $progress A value that can be safely serialize()'ed. */ public function publishProgress($progress){ - $this->progressUpdates[] = $progress; + $this->progressUpdates[] = serialize($progress); } /** @@ -187,9 +187,9 @@ abstract class AsyncTask extends Collectable{ * @param Server $server */ public function checkProgressUpdates(Server $server){ - if($this->progressUpdates->count() !== 0){ + while($this->progressUpdates->count() !== 0){ $progress = $this->progressUpdates->shift(); - $this->onProgressUpdate($server, $progress); + $this->onProgressUpdate($server, unserialize($progress)); } }