File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,8 +51,6 @@ matrix:
5151 - php -r "file_put_contents(php_ini_loaded_file(),'extension=event'.PHP_EOL,FILE_APPEND);"
5252 install :
5353 - composer install
54- script :
55- - vendor/bin/phpunit --coverage-text || ([[ $? = 139 ]] && echo && echo "Ignoring SEGFAULT.." >&2) # ignore unrelated SEGFAULT when all tests pass
5654 allow_failures :
5755 - php : hhvm
5856 - os : windows
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ public function __construct()
5959 $ this ->createStreamCallback ();
6060 }
6161
62+ public function __destruct ()
63+ {
64+ // explicitly clear all references to Event objects to prevent SEGFAULTs on Windows
65+ foreach ($ this ->timerEvents as $ timer ) {
66+ $ this ->timerEvents ->detach ($ timer );
67+ }
68+
69+ $ this ->readEvents = array ();
70+ $ this ->writeEvents = array ();
71+ }
72+
6273 public function addReadStream ($ stream , $ listener )
6374 {
6475 $ key = (int ) $ stream ;
You can’t perform that action at this time.
0 commit comments