소스 검색

Update Event.php

Linfly 2 년 전
부모
커밋
db19df0ff9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/Events/Event.php

+ 2 - 1
src/Events/Event.php

@@ -102,7 +102,8 @@ class Event implements EventInterface
     {
         $className = $this->eventClassName;
         $timerId = $this->timerId++;
-        $event = new $className($this->eventBase, -1, $className::TIMEOUT, function () use ($func, $args) {
+        $event = new $className($this->eventBase, -1, $className::TIMEOUT, function () use ($func, $args, $timerId) {
+            unset($this->eventTimer[$timerId]);
             try {
                 $func(...$args);
             } catch (Throwable $e) {