fix(single-instance): release the lock on cleanup_before_exit instead of RunEvent::Exit (#3482)

* add configurable destroy_on_exit to single instance plugin

* add change file

* document destroy_on_exit

* move the destroy to rely on the Resource close

* add integration test

* fix android/ios

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
JGuest121andLucas Nogueira authored and GitHub committed 2026-10-16 16:06:24 -03:00
1 parent 8dc878fe34
commit aedd883cf3
8 files changed
+316 -68

No files matched your search

@@ -0,0 +1,5 @@
---
"single-instance": patch
---
Release the single instance lock in `AppHandle::cleanup_before_exit`, right before the process exits or restarts, instead of on `RunEvent::Exit`. The app now remains the single instance while your own `RunEvent::Exit` handler runs. `destroy` can still release the lock earlier.