WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit e4c57f1

Browse files
committed
Move stopped check to be after cycle collection
1 parent 883521f commit e4c57f1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/EventLoop/Internal/AbstractDriver.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ public function __construct()
9191
$this->queueCallback = $this->queue(...);
9292
$this->runCallback = function (): ?\Closure {
9393
do {
94-
if ($this->stopped) {
95-
return null;
96-
}
97-
9894
if ($this->fiber->isTerminated()) {
9995
$this->createLoopFiber();
10096
}
@@ -103,7 +99,7 @@ public function __construct()
10399
if ($result) { // Null indicates the loop fiber terminated without suspending.
104100
return $result;
105101
}
106-
} while (!$this->stopped && \gc_collect_cycles());
102+
} while (\gc_collect_cycles() && !$this->stopped);
107103

108104
return null;
109105
};

0 commit comments

Comments
 (0)