From 79d8aaa0bdf128364b813404012d1b45d4e8ac04 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 21 Aug 2017 08:54:34 -0400 Subject: [PATCH] Fix #50: bad fsevent example --- examples/fsevevnt.php | 8 +++----- php_uv.c | 8 ++++++-- tests/320-fs-event.phpt | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/fsevevnt.php b/examples/fsevevnt.php index 4f818b0..1946cf9 100644 --- a/examples/fsevevnt.php +++ b/examples/fsevevnt.php @@ -1,10 +1,8 @@ loop; - if ((php_uv_loop_t *) obj != UV_G(default_loop)) { + php_uv_loop_t *loop_obj = (php_uv_loop_t *) obj; + uv_loop_t *loop = &loop_obj->loop; + if (loop_obj != UV_G(default_loop)) { uv_stop(loop); /* in case we haven't stopped the loop yet otherwise ... */ uv_run(loop, UV_RUN_DEFAULT); /* invalidate the stop ;-) */ @@ -1204,6 +1205,9 @@ void static destruct_uv_loop(zend_object *obj) uv_run(loop, UV_RUN_DEFAULT); uv_loop_close(loop); } + if (loop_obj->gc_buffer) { + efree(loop_obj->gc_buffer); + } } void static clean_uv_handle(php_uv_t *uv) { diff --git a/tests/320-fs-event.phpt b/tests/320-fs-event.phpt index 098cf78..1101876 100644 --- a/tests/320-fs-event.phpt +++ b/tests/320-fs-event.phpt @@ -3,9 +3,9 @@ Check for fs event --FILE--