| 89 | auto operator<=>(const UvHandle& that) const = default; |
| 90 | |
| 91 | void reset() { |
| 92 | auto* h = handle(); |
| 93 | if (h != nullptr) { |
| 94 | if (uv_handle_get_type(h) == UV_UNKNOWN_HANDLE) { |
| 95 | // Never initialized, so it is on no loop and there is nothing to |
| 96 | // close, e.g. NodeBindings::dummy_uv_handle_ when a frame goes away |
| 97 | // before PrepareEmbedThread() runs. |
| 98 | delete t_; |
| 99 | } else { |
| 100 | DCHECK_EQ(0, uv_is_closing(h)); |
| 101 | uv_close(h, OnClosed); |
| 102 | } |
| 103 | t_ = nullptr; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | private: |
| 108 | static void OnClosed(uv_handle_t* handle) { |