diff --git a/src/pocketmine/scheduler/AsyncPool.php b/src/pocketmine/scheduler/AsyncPool.php index 1fdc19815..4eea79b73 100644 --- a/src/pocketmine/scheduler/AsyncPool.php +++ b/src/pocketmine/scheduler/AsyncPool.php @@ -74,7 +74,8 @@ class AsyncPool{ private function removeTask(AsyncTask $task){ if(isset($this->taskWorkers[$task->getTaskId()])){ - $this->workers[$this->taskWorkers[$task->getTaskId()]]->unstack($task); + $this->workers[$w = $this->taskWorkers[$task->getTaskId()]]->unstack($task); + $this->workerUsage[$w]--; } unset($this->tasks[$task->getTaskId()]);