[bug] App::cleanup_before_exit() can crash if not run on main thread #12534
Labels
platform: macOS
priority: 1 high
status: needs triage
This issue needs to triage, applied to new issues
type: bug
Describe the bug
If an app has some resources that need to be cleaned up and the OS requires them to be cleaned up on main thread then calling
cleanup_before_exit()
from a worker thread may cause a crash.I observed this crash reliably with a tray icon app on MacOS, see crash backtrace below.
Reproduction
I don't have a minimal repro but you can look at my fix for this issue for my app and if you compile the parent commit the issue will reproduce.
Expected behavior
Any cleanup that should happen on main thread should be handled on main thread inside the
cleanup_before_exit()
methodFull
tauri info
outputStack trace
Additional context
No response
The text was updated successfully, but these errors were encountered: