diff --git a/lib/functions.php b/lib/functions.php index 3e5f185..abba62a 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -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);