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 crash on windows (error code: 1410) when tray icon created again #57

Merged
merged 2 commits into from
Apr 7, 2024
Merged

Fix crash on windows (error code: 1410) when tray icon created again #57

merged 2 commits into from
Apr 7, 2024

Conversation

felixmaker
Copy link
Contributor

It's common to create tray icon again in a GUI application. However, the process crashes when tray icon created at the second time.

Because,

All window classes that an application registers are unregistered when it terminates.

See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerclassw#remarks

When the application creates tray icon again, calling to RegisterClassW will return error.

Maybe, we can ignore errors from calling RegisterClassW just like tauri-apps/tray-icon does.

See https://github.com/tauri-apps/tray-icon/blob/302f29e48c2dc4cec1adc9ef67a80d93c0c90b16/src/platform_impl/windows/mod.rs#L89

@olback olback merged commit 5374b93 into olback:master Apr 7, 2024
3 checks passed
@olback
Copy link
Owner

olback commented Apr 7, 2024

Hi, thanks for your contribution!

This is now released under version 0.10.0.

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.

2 participants