| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1253650 commit 94c4323
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,6 +207,19 @@ inline Environment::~Environment() { | |||
| 207 | 207 | delete hc; | |
| 208 | 208 | } | |
| 209 | 209 | ||
| 210 | + while (handle_cleanup_waiting_ != 0) | ||
| 211 | + uv_run(event_loop(), UV_RUN_ONCE); | ||
| 212 | + | ||
| 213 | + // Closing the destroy_ids_idle_handle_ within the handle cleanup queue | ||
| 214 | + // prevents the async wrap destroy hook from being called. | ||
| 215 | + uv_handle_t* handle = | ||
| 216 | + reinterpret_cast<uv_handle_t*>(&destroy_ids_idle_handle_); | ||
| 217 | + handle->data = this; | ||
| 218 | + handle_cleanup_waiting_ = 1; | ||
| 219 | + uv_close(handle, [](uv_handle_t* handle) { | ||
| 220 | + static_cast<Environment*>(handle->data)->FinishHandleCleanup(handle); | ||
| 221 | + }); | ||
| 222 | + | ||
| 210 | 223 | while (handle_cleanup_waiting_ != 0) | |
| 211 | 224 | uv_run(event_loop(), UV_RUN_ONCE); | |
| 212 | 225 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments