Skip to content

Commit 2dfc2e8

Browse files
committed
Unset canceller callback on resolution
1 parent 36e2854 commit 2dfc2e8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Promise.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function always(callable $onFulfilledOrRejected)
7676

7777
public function cancel()
7878
{
79-
if (null === $this->canceller || null !== $this->result) {
79+
if (null === $this->canceller) {
8080
return;
8181
}
8282

@@ -130,6 +130,7 @@ private function settle(PromiseInterface $result)
130130
$handlers = $this->handlers;
131131

132132
$this->handlers = [];
133+
$this->canceller = null;
133134
$this->result = $result;
134135

135136
foreach ($handlers as $handler) {

0 commit comments

Comments
 (0)