Skip to content

Commit

Permalink
Unreference watcher in Amp\timout()
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 17, 2016
1 parent 8ef760f commit bc1ae18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ function timeout(Promise $promise, int $timeout): Promise {
$deferred->fail(new TimeoutException);
}
});
Loop::unreference($watcher);

$promise->when(function () use (&$resolved, $promise, $deferred, $watcher) {
Loop::cancel($watcher);
Expand Down

0 comments on commit bc1ae18

Please sign in to comment.