GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — timers: allow Immediates to be unrefed · nodejs/node@e15f577

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/addons-napi/test_uv_loop
    • test_uv_loop.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/addons-napi/test_uv_loop/test_uv_loop.cc‎

Copy file name to clipboardExpand all lines: test/addons-napi/test_uv_loop/test_uv_loop.cc
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ void* SetImmediate(napi_env env, T&& cb) {
2424

2525
assert(cb() != nullptr);
2626
});
27+
// Idle handle is needed only to stop the event loop from blocking in poll.
28+
uv_idle_t* idle = new uv_idle_t;
29+
uv_idle_init(loop, idle);
30+
uv_idle_start(idle, [](uv_idle_t* idle) {
31+
uv_close(reinterpret_cast<uv_handle_t*>(idle), [](uv_handle_t* handle) {
32+
delete reinterpret_cast<uv_check_t*>(handle);
33+
});
34+
});
35+
2736
return nullptr;
2837
}
2938

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.