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

When exitProcessOnClose is set to true, closing the app will result in +5 sec freeze before the app closes on Windows #1179

Open
Nassim-Saboundji opened this issue Dec 4, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@Nassim-Saboundji
Copy link

Nassim-Saboundji commented Dec 4, 2023

Describe the bug
When exitProcessOnClose is set to true, closing the app will result in +5 sec freeze before the app closes on Windows

To Reproduce

  1. set exitProcessOnClose to true in neutralino.config.json.
  2. Open the app.
  3. Try closing it.

Expected behavior
The app should close immediately. However, we have a +5 sec delay before closing. Which is not what we want.

Specifications

  • OS: Windows 11
  • Neutralinojs version : 4.14.1
  • Neutralinojs client library version: 3.12.0
  • Neutralinojs CLI version: 10.1.0

Note: you can enter the neu version command to find these details

Additional context
The issue does not occur when using this workaround in main.js instead of relying on existProcessOnClose.

Neutralino.init();
Neutralino.events.on("windowClose", () => {
  Neutralino.app.exit();
});
@Nassim-Saboundji Nassim-Saboundji added the bug Something isn't working label Dec 4, 2023
@ContrerasA
Copy link

Something similar happens when creating a react application as outlined under the "Using any frontend library" section of the docs

https://neutralino.js.org/docs/getting-started/using-frontend-libraries

In my case, when I press the X button to exit, the application hangs for 10 seconds before closing.
I have not found how to use the workaround shown above since there is no main.js file

@thorin8k
Copy link

thorin8k commented Jan 3, 2024

Same here, tested in 4.15.0 and same results.

The workaround seems to be working fine.

@Rylazius
Copy link

same, neutralino v4.14.1, client v3.12.0, workaround working fine but not the exitProcessOnClose

@multiman95
Copy link

Describe the bug When exitProcessOnClose is set to true, closing the app will result in +5 sec freeze before the app closes on Windows

To Reproduce

  1. set exitProcessOnClose to true in neutralino.config.json.
  2. Open the app.
  3. Try closing it.

Expected behavior The app should close immediately. However, we have a +5 sec delay before closing. Which is not what we want.

Specifications

  • OS: Windows 11
  • Neutralinojs version : 4.14.1
  • Neutralinojs client library version: 3.12.0
  • Neutralinojs CLI version: 10.1.0

Note: you can enter the neu version command to find these details

Additional context The issue does not occur when using this workaround in main.js instead of relying on existProcessOnClose.

Neutralino.init();
Neutralino.events.on("windowClose", () => {
  Neutralino.app.exit();
});

how to use the workaround please?

@Nassim-Saboundji
Copy link
Author

Describe the bug When exitProcessOnClose is set to true, closing the app will result in +5 sec freeze before the app closes on Windows

To Reproduce

  1. set exitProcessOnClose to true in neutralino.config.json.
  2. Open the app.
  3. Try closing it.

Expected behavior The app should close immediately. However, we have a +5 sec delay before closing. Which is not what we want.

Specifications

  • OS: Windows 11
  • Neutralinojs version : 4.14.1
  • Neutralinojs client library version: 3.12.0
  • Neutralinojs CLI version: 10.1.0

Note: you can enter the neu version command to find these details

Additional context The issue does not occur when using this workaround in main.js instead of relying on existProcessOnClose.

Neutralino.init();
Neutralino.events.on("windowClose", () => {
  Neutralino.app.exit();
});

how to use the workaround please?

Add the code shown above where you use the Neutralino object in your project. Usually it's in main.js

@kwisatz
Copy link

kwisatz commented Feb 29, 2024

I had created a duplicate ticket of this on the wrong (?) project: neutralino.jsj #102

The workaround that is described above is what was in my app by default after neu create-ing it. This resulted in the app not closing at all on Windows.
Removing it now exhibits the behavior described by the OP. However, we have seen the time ranging from 2 seconds to more than 10 seconds on some Windows installations.

@AntumDeluge
Copy link

AntumDeluge commented Jun 6, 2024

My project is experiencing the same, or a similar, issue, to the point of a "Not Responding" message in title bar. Even using the windowClose event the issue persists: arianne/stendhal#696

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants