-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspector: Fix the inspector connection cleanup #7268
Conversation
Relaunched CI: https://ci.nodejs.org/job/node-test-commit/3765/. Looks green. PTAL @nodejs/diagnostics. |
@@ -401,14 +401,13 @@ void AgentImpl::ThreadCbIO(void* agent) { | |||
// static | |||
void AgentImpl::OnSocketConnectionIO(uv_stream_t* server, int status) { | |||
if (status == 0) { | |||
inspector_socket_t* socket = | |||
static_cast<inspector_socket_t*>(malloc(sizeof(*socket))); | |||
inspector_socket_t* socket = new inspector_socket_t(); | |||
ASSERT_NE(nullptr, socket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ASSERT_NE is useless now (and should have been a CHECK_EQ in hindsight.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. Thanks!
In some cases close callback was called twice, while in some cases the memory was still not released at all.
LGTM |
In some cases close callback was called twice, while in some cases the memory was still not released at all. PR-URL: #7268 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Landed as 9dfc8b9. |
In some cases close callback was called twice, while in some cases the memory was still not released at all. PR-URL: #7268 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Checklist
make -j4 test
(UNIX) orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
This change only touches inspector connection
Description of change
In some cases close callback was called twice while other codepaths ended up
not releasing the memory at all.
CC: @ofrobots