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

Fix exception on close of IDE #1500

Merged
merged 1 commit into from
Oct 24, 2018
Merged

Fix exception on close of IDE #1500

merged 1 commit into from
Oct 24, 2018

Conversation

brusherru
Copy link
Contributor

@brusherru brusherru commented Oct 24, 2018

While some process that communicates through IPC using promifisyIpc and subscribeIpc modules is running it tries to send process/success/failure messages to the renderer from the main process. For example, installing arduino C++ libraries, arduino packages, upload to the board and etc.
So when User closes IDE while a process is running it causes exception, cause the main process can't send data to the renderer, that was destroyed.

Fortunately, electron developers added a method event.sender.isDestroyed(), so we can avoid sending data to the destroyed process. That I did in this PR and it fixes the bug.

How to reproduce the bug

  1. Open previous IDE version.
  2. Start installation of some arduino package.
  3. Close the window before it's done.
  4. You'll see an exception in the OS dialog window.

Then you can checkout this branch and repeat these steps to be sure it works fine :)

@brusherru brusherru self-assigned this Oct 24, 2018
@brusherru brusherru requested a review from a team October 24, 2018 09:53
Copy link
Member

@nkrkv nkrkv left a comment

Choose a reason for hiding this comment

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

👌

@nkrkv
Copy link
Member

nkrkv commented Oct 24, 2018

Works fine on Linux. What I’ve noted also:

  • I started the application with yarn start:electron
  • I started installing the esp8266 package
  • Shortly after the first archive started to download I closed the XOD IDE window
  • The terminal process kept running for another 20 seconds or so, that is, it was not SIGTERM’d right away

I’m not sure is it OK or the same symptoms as on Windows.

@brusherru brusherru merged commit d06493a into 0.25.x Oct 24, 2018
@brusherru brusherru deleted the fix-exception-on-close branch October 24, 2018 12:53
@nkrkv nkrkv added the hotfix Issue/PR for a patch release label Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotfix Issue/PR for a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants