-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
fix: dangling raw_ptr in OSRWHV destructor #41088
Conversation
`delegated_frame_host_` holds a pointer to `delegated_frame_host_client_`. Since `delegated_frame_host_client_` was being destroyed first, that pointer was dangling in the OSRWHV destructor. Also, make these two unique_ptr fields `const` since they point to the same objects for the lifespan of the OSRWHV.
compositor_.reset(); | ||
root_layer_.reset(); |
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.
Do these two calls need to be explicit in the destructor ?
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.
@deepak1556 good catch, I was going to remove them for that reason: you're right, they're entirely redundant.
I decided to leave them alone here because it's a little off-topic for this bugfix PR, and I have another cleanup PR in mind where it's a better fit.
No Release Notes |
I have automatically backported this PR to "28-x-y", please check out #41116 |
I have automatically backported this PR to "29-x-y", please check out #41117 |
Description of Change
delegated_frame_host_
holds a pointer todelegated_frame_host_client_
. Sincedelegated_frame_host_client_
was being destroyed first, that pointer was dangling in the OSRWHV destructor.Also, make these two unique_ptr fields
const
since they point to the same objects for the lifespan of the OSRWHV.Checklist
npm test
passesRelease Notes
Notes: none