-
Notifications
You must be signed in to change notification settings - Fork 1
fix(electron-ozone): NativeWindowViews leak on rohtmlwidget cycle OS-21158 #140
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
base: 28-x-y-bs
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -521,8 +521,15 @@ void NativeWindowViews::SetWindowTransform( | |
| #endif | ||
|
|
||
| void NativeWindowViews::SetContentView(views::View* view) { | ||
| if (content_view()) { | ||
| root_view_.RemoveChildView(content_view()); | ||
| auto* cv = content_view(); | ||
| if (cv) { | ||
| set_content_view(nullptr); | ||
| focused_view_ = nullptr; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this as focused_view_ will always be set below?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| if (!cv->owned_by_client()) { | ||
| root_view_.RemoveChildViewT(cv); | ||
| } else { | ||
| root_view_.RemoveChildView(cv); | ||
| } | ||
|
Comment on lines
+528
to
+532
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gostoshbs |
||
| } | ||
| set_content_view(view); | ||
| focused_view_ = view; | ||
|
|
||
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 we need this as set_content_view will always be called below and all it does is set content_view_?
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.
This defends against use after free when RemoveChildViewT path triggers