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

Reduce delay before app closes on windows #1243

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

Spishous
Copy link
Contributor

@Spishous Spishous commented Apr 8, 2024

Description

in certain Windows configurations, the signal expected by "WaitForSingleObject" before closing the application window (when "exitProcessOnClose" is true in neutralino.config.json), is not received. Which creates a freeze lasting from 2sec to 10sec on some machines. #1179

Changes proposed

  • Reduced WaitForSingleObject delay

Next steps

I don't know enough about C++ to delve deeper into the problem. But the next step would be to see why when "exitProcessOnClose" is true, the behavior of the closure changes and blocks at this step.

None.

@Spishous
Copy link
Contributor Author

Spishous commented Apr 8, 2024

@nicorac

@Spishous Spishous changed the title Reduce delay before app closes on windows #1179 Reduce delay before app closes on windows Apr 8, 2024
@nicorac
Copy link
Contributor

nicorac commented Apr 22, 2024

Well, the WaitForSingleObject delay is not really a "delay" but a timeout: the function waits for at most 10000ms for the watched handle to be released (at window destruction).
It was added because the applicaiton did not correctly release its resources, leading to handle leaks.

That said, the question is: is this new behavior related to Windows 11?
The OP of #1179 runs Win11, but others not, so I'm not sure...

Sadly I'm actually not able to further investigate on it, I'm sorry 😔

@moritz-baecker-integra
Copy link

Well, the WaitForSingleObject delay is not really a "delay" but a timeout: the function waits for at most 10000ms for the watched handle to be released (at window destruction). It was added because the applicaiton did not correctly release its resources, leading to handle leaks.

That said, the question is: is this new behavior related to Windows 11? The OP of #1179 runs Win11, but others not, so I'm not sure...

Sadly I'm actually not able to further investigate on it, I'm sorry 😔

This behavior also happens on Windows 10 (Version 10.0.19045 Build 19045). I have to wait multiple seconds for the window to close.

@AntumDeluge
Copy link

Same here, on Windows 10.

Copy link
Member

@shalithasuranga shalithasuranga left a comment

Choose a reason for hiding this comment

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

Thanks so much @Spishous for sending this pull request 🎉

@shalithasuranga shalithasuranga merged commit f464036 into neutralinojs:main Sep 18, 2024
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.

5 participants