From e7a1982170d163421ac0f4ddff7a9e884ac1fd8e Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Thu, 25 May 2023 00:10:35 +0800 Subject: [PATCH] =?UTF-8?q?uv=5Fstop=E7=9A=84=E4=BE=8B=E5=AD=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/src/uv_test/test.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/src/uv_test/test.cpp b/test/src/uv_test/test.cpp index cda2cd1..545ff79 100644 --- a/test/src/uv_test/test.cpp +++ b/test/src/uv_test/test.cpp @@ -11,7 +11,7 @@ uv_async_t async; uv_async_t async2; -uv_async_t stopsig; +uv_async_t stopsig; uv_loop_t* loop; @@ -42,7 +42,7 @@ void async_cb2(uv_async_t* handle) void idle_cb(uv_async_t *handle) { printf("Idle callback\n"); - uv_stop(uv_default_loop()); + uv_stop(uv_default_loop()); // 一定要在回调函数内去调用,主函数内调用不生效。 } @@ -74,7 +74,6 @@ int main() }); t1.detach(); uv_run(loop, UV_RUN_DEFAULT); - uv_stop(loop); return 0; }