-
Notifications
You must be signed in to change notification settings - Fork 1.1k
win32: drop application handler on WM_ENDSESSION
#4425
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,7 +219,6 @@ impl EventLoop { | |
| mut app: A, | ||
| ) -> Result<(), EventLoopError> { | ||
| #[cfg(any( | ||
| windows_platform, | ||
| macos_platform, | ||
| android_platform, | ||
| orbital_platform, | ||
|
|
@@ -232,6 +231,10 @@ impl EventLoop { | |
| drop(app); | ||
| result | ||
| } | ||
| #[cfg(windows_platform)] | ||
| { | ||
| self.event_loop.run_app_on_demand(app) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this a separate call on Windows to pass in the ownership of let result = self.event_loop.run_app_on_demand(&mut app);
// SAFETY: unsure that the state is dropped before the exit from the event loop.
drop(app);
result
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was done like that, because
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure that it's wrong too?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So should I change this for all platforms? |
||
| } | ||
| #[cfg(web_platform)] | ||
| { | ||
| self.event_loop.register_app(app); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help testing this, you could try https://github.com/Legend-Master/windows-restart-manager-test, replace
let file_path = HSTRING::from(r"");to the executable path you want to terminate, andcargo run