fix(app): throw error popup when close window #1144
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Once the window is destroyed, none of the window's methods can be used (except for
destroy
andisDestroyed
).Linked Issues
Fix: #1127 #1092
Additional context
The reason that destroy can be called multiple times is that Electron performs a check: https://github.com/electron/electron/blob/57920e7747f09627f99ed5c27457339aa7c3fe57/shell/common/gin_helper/destroyable.cc#L28
The ability to call isDestroyed is because no window methods are used during the implementation process: https://github.com/electron/electron/blob/57920e7747f09627f99ed5c27457339aa7c3fe57/shell/common/gin_helper/destroyable.cc#L48-L49