1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

Move Coroutine::__destruct to Placeholder

This commit is contained in:
Niklas Keller 2019-05-20 20:32:19 +02:00 committed by Aaron Piotrowski
parent 58c7bfb689
commit 944a2dd29d
2 changed files with 11 additions and 11 deletions

View File

@ -144,15 +144,4 @@ final class Coroutine implements Promise
});
}
}
public function __destruct()
{
try {
$this->result = null;
} catch (\Throwable $e) {
Loop::defer(static function () use ($e) {
throw $e;
});
}
}
}

View File

@ -155,4 +155,15 @@ trait Placeholder
{
$this->resolve(new Failure($reason));
}
public function __destruct()
{
try {
$this->result = null;
} catch (\Throwable $e) {
Loop::defer(static function () use ($e) {
throw $e;
});
}
}
}