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

Splash Screen is destroyed on macOS #2010

Closed
2 of 7 tasks
bcallaghan-fri opened this issue Sep 28, 2019 · 2 comments · Fixed by #2044
Closed
2 of 7 tasks

Splash Screen is destroyed on macOS #2010

bcallaghan-fri opened this issue Sep 28, 2019 · 2 comments · Fixed by #2044

Comments

@bcallaghan-fri
Copy link

Description of the problem:
When closing the main window on macOS, the following error is displayed.

A JavaScript error occurred in the browser process
Error: Object has been destroyed
    at BrowserWindow.<anonymous> (/Users/.../node_modules/@capacitor/electron/index.js:115:25)
    at BrowserWindow.emit (events.js:205:15)

This error does not occur on Windows. The method in question is

this.mainWindowRef.on('closed', () => {
    this.splashWindow.close();
});

On Windows, this.splashWindow.isDestroyed() returns false before close is called. On macOS, isDestroyed() returns true. The result is a popup window visible to the user.

Affected platform

  • Android
  • iOS
  • electron
  • web

OS of the development machine

  • Windows
  • macOS
  • linux

Capacitor version: 1.2.0

node version: 12.4.0

npm version: 6.9.0

@shadowflipbot
Copy link

I am getting the same thing on Windows. I am getting it only when I am doing autoUpdater.quitAndInstall(); not a normal exit.

npm 6.11.3
node 10.15.3
Capacitor 1.2.0

walkingriver added a commit to walkingriver/capacitor that referenced this issue Oct 12, 2019
Resolves ionic-team#2010 on MacOS. 

The issue stems from the splash screen being destroyed already, so I'm simply adding a check to ensure that the splash screen reference has a value and that it isn't already destroyed. This seems to solve the problem in a straightforward manner.
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 13, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants