Skip to content
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

App crashes when BrowserView tries to both resize and destroy itself (almost) simultaneously #21410

Closed
3 tasks done
jiwonchang opened this issue Dec 6, 2019 · 3 comments · Fixed by #25411
Closed
3 tasks done

Comments

@jiwonchang
Copy link

jiwonchang commented Dec 6, 2019

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

I'm currently using BrowerView to act as a makeshift tab (so that I may have multiple "tabs" of my application open). When I create 20+ processes and shut them down (shutting them down calls view.destroy()) very quickly and then right afterwards try to resize the window, the app crashes with Error 3221226525.

When I disable the call to view.destroy(), I no longer get this issue. This works, since Javascript garbage collection will collect the processes after a minute or two, but this solution seems a bit suboptimal and unreliable in the case where we may have weak references left over.

I tried to work around this by disabling resizing for those BrowserViews (via view.setAutoResize()) and then calling view.destroy(), but this does not fix the issue.

  • Electron Version:
    • 7.1.2
  • Operating System:
    • Windows 10
  • Last Known Working Electron version:
    • N/A

Expected Behavior

Close many BrowserViews quickly and then Resize right afterwards --> Window should resize without crashing.

Actual Behavior

Close many BrowserViews quickly and then Resize right afterwards --> App crashes (if I don't resize, no crash).

To Reproduce

As mentioned above, we need to create 20+ processes and shut them down (shutting them down calls view.destroy()) very quickly and then right afterwards try to resize the window. The app should crash with Error 3221226525.

Screenshots

IceT Nova BrowserView Crash Error

Additional Information

This problem exists in both Electron v5.0.0 and v7.1.2.

Question: Let's say I take the "don't destroy, let processes get garbage collected" route. Is it possible that the app will also crash during garbage collection if the user happens to resize just as a process is being destroyed?

Thank you for your time, and I look forward to hearing from you!

@jiwonchang
Copy link
Author

Hello @sofianguy ,

Are there any updates to this? I'm hoping that this issue can be resolved soon as I find the garbage collection process to be unreliable (as it does not successfully collect all garbage and leave a few hanging around).

Please let me know. Thank you!

@pushkin-
Copy link

pushkin- commented Mar 5, 2020

@jiwonchang destroying the browserview appears to be for force-close types of scenarios. I wonder if you can just do browserWindow.removeBrowserView(browserView) for all of the views. Are you doing this workflow when shutting down the entire app, or just the browser view processes?

Also does this happen when manually resizing or when programmatically resizing?

@codebytere
Copy link
Member

Closed in #25411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
7.2.x
Unsorted Issues
Development

Successfully merging a pull request may close this issue.

4 participants