Fixed array progress crashing

Forgot to serialize them. They would be converted to Volatile, which is Threaded. Threaded objects still crash with progressUpdates.
This commit is contained in:
SOFe 2016-11-12 18:57:52 +08:00
parent d5881dbe83
commit 75fa2f1132
No known key found for this signature in database
GPG Key ID: A0379676C4D9D5D9

View File

@ -178,7 +178,7 @@ abstract class AsyncTask extends Collectable{
* @param mixed $progress A value that can be safely serialize()'ed. * @param mixed $progress A value that can be safely serialize()'ed.
*/ */
public function publishProgress($progress){ public function publishProgress($progress){
$this->progressUpdates[] = $progress; $this->progressUpdates[] = serialize($progress);
} }
/** /**
@ -187,9 +187,9 @@ abstract class AsyncTask extends Collectable{
* @param Server $server * @param Server $server
*/ */
public function checkProgressUpdates(Server $server){ public function checkProgressUpdates(Server $server){
if($this->progressUpdates->count() !== 0){ while($this->progressUpdates->count() !== 0){
$progress = $this->progressUpdates->shift(); $progress = $this->progressUpdates->shift();
$this->onProgressUpdate($server, $progress); $this->onProgressUpdate($server, unserialize($progress));
} }
} }