ext-uv/tests/006-uv_async_init-no-memory-leak.phpt
Bob Weinand e2a6bcddae Merge branch 'fix-memory-leak' of https://github.com/Ezaki113/php-uv
Also fix memory leaks in general when closing without previous explicit stop
2017-02-28 18:22:45 +01:00

23 lines
351 B
PHP

--TEST--
Check uv_async has no memory leak
--FILE--
<?php
$m = memory_get_usage();
$loop = uv_loop_new();
$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