Don't load URL if web contents is destroyed #8254

Merged
merged 2 commits into from Dec 28, 2016

Projects

None yet

1 participant

@kevinsawicki
Contributor

Closing a window from a will-navigate listener but not calling event.preventDefault() would crash the app because the URL would continue to load in a destroyed web contents.

This adds a check to see if the web contents was marked as destroyed after the will-navigate event is emitted.

Closes #4374

kevinsawicki added some commits Dec 21, 2016
@kevinsawicki kevinsawicki Don't load URL if web contents is destroyed 1308f79
@kevinsawicki kevinsawicki Add spec for closing from will-navigate listener
abea119
@kevinsawicki kevinsawicki merged commit bc39964 into master Dec 28, 2016

0 of 6 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
electron-linux-arm Build #5056209 started
Details
electron-linux-ia32 Build #5056210 queued
Details
electron-linux-x64 Build #5056211 queued
Details
electron-osx-x64 Build #3098 in progress...
Details
@kevinsawicki kevinsawicki deleted the webcontents-will-navigate-crash branch Dec 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment