-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: do not leak NodeTraceStateObserver #25180
Conversation
This would otherwise be reported as a memory leak by automated tools.
The crashes look relevant?
|
@@ -235,6 +237,7 @@ static struct { | |||
// Destroy tracing after the platform (and platform threads) have been | |||
// stopped. | |||
tracing_agent_.reset(nullptr); | |||
trace_state_observer_.reset(nullptr); |
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.
Should we call controller->RemoveTraceStateObserver(trace_state_observer_.get())
here? (It's currently run in OnTraceEnabled
but it may not be ever enabled?)
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.
I’m not sure, but does the controller still exist at this point?
@joyeecheung Thanks for pointing out the failures – afaict it was a double free for the cases where the tracing observer was enabled and cleaned up after itself. It might be nice to keep that behaviour, but I don’t think it’s important… |
Landed in b4145b8 |
This would otherwise be reported as a memory leak by automated tools. PR-URL: #25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools. PR-URL: #25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools. PR-URL: nodejs#25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools. PR-URL: #25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools. PR-URL: #25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools. PR-URL: #25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools. PR-URL: #25180 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
This would otherwise be reported as a memory leak by automated tools.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes