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

Desktop: Fixes #8591 - Error while quitting the app #8612

Merged
merged 1 commit into from Aug 4, 2023
Merged

Conversation

hubertfilho
Copy link
Contributor

By the stack track the error is when trying read webContents from BrowserWindow, and it's happening when the app is about to close. So, after I analysed the code and did some tests I just added a verification in the part of the code when I believe the error is happening. I couldn't reproduce the problem on my machine. I hope it solve the problem.

@@ -174,7 +174,7 @@ export default class ElectronAppWrapper {
// so that it can tell us if we can really close the app or not.
// Search for "appClose" event for closing logic on renderer side.
event.preventDefault();
this.win_.webContents.send('appClose');
if (this.win_) this.win_.webContents.send('appClose');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code inside if (isGoingToExit) is running 3 times after closing the app and at the thirty time this.win_ is null. So, I think in some cases it's entering the next if statement if (!this.rendererProcessQuitReply_) and causing the problem. I hope it makes sense.

@laurent22
Copy link
Owner

Looks good, thanks Hubert

@laurent22 laurent22 merged commit 6c2e0d9 into dev Aug 4, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants