Skip to content

Commit

Permalink
TcpConnectionHandle.cpp: properly close handle
Browse files Browse the repository at this point in the history
This is the same change as done in PR #1411 but here in `TcpConnectionHandle.cpp`.
  • Loading branch information
ibc committed Jun 19, 2024
1 parent 81e2099 commit 08bdf56
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions worker/src/handles/TcpConnectionHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,14 @@ inline static void onCloseTcp(uv_handle_t* handle)
delete reinterpret_cast<uv_tcp_t*>(handle);
}

inline static void onCloseShutdown(uv_handle_t* handle)
{
delete reinterpret_cast<uv_shutdown_t*>(handle);
}

inline static void onShutdown(uv_shutdown_t* req, int /*status*/)
{
auto* handle = req->handle;

delete req;

// Now do close the handle.
uv_close(reinterpret_cast<uv_handle_t*>(handle), static_cast<uv_close_cb>(onCloseShutdown));
uv_close(reinterpret_cast<uv_handle_t*>(handle), static_cast<uv_close_cb>(onCloseTcp));
}

/* Instance methods. */
Expand Down

0 comments on commit 08bdf56

Please sign in to comment.