-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Delay removing iframe to fix renderer crash #6952
Conversation
Signed-off-by: Sebastian Malton <sebastian@malton.name>
parentElem.removeChild(iframe); | ||
|
||
// Must only remove iframe from DOM after it unloads old code. Else it crashes | ||
iframe.addEventListener("load", () => parentElem.removeChild(iframe), { |
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.
"load"
? How does this work?
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.
That event even fires when the load fails.
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 guess I don't see where the "load"
event gets called in this situation. By iframe.setAttribute("src", "");
?
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.
https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
This means that the DOM and all script resources have been loaded.
An empty src means "no src" or empty since that is the default.
There's still an issue with connection races but the renderer process is not getting killed anymore. Screen.Recording.2023-01-16.at.5.46.43.PM.movPlus the context menu doesn't always come up right away, or respond right away. |
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.
Approving as it fixes the crash. I discovered that this bug is manifested by #6851 (bug exists at that PR commit, but not if you check out the commit just before)
What kind of renderer crash it fixes? This one #6934? |
@aleksfront Yes |
Signed-off-by: Sebastian Malton sebastian@malton.name
fixes #6934