ext-uv/tests/006-uv_async_init-no-memory-leak.phpt
2017-02-24 18:27:24 +03:00

25 lines
401 B
PHP

--TEST--
Check uv_async has no memory leak
--FILE--
<?php
$m = memory_get_usage();
$loop = uv_loop_new();
for ($i = 0; $i < 1; $i++) {
$async = uv_async_init($loop, static function ($async) {
uv_close($async);
});
uv_async_send($async);
}
unset($async);
uv_run($loop, UV::RUN_DEFAULT);
uv_loop_delete($loop);
unset($loop);
echo memory_get_usage() - $m, PHP_EOL;
--EXPECTF--
0