fix: allow graceful shutdown of sidecar commands on exit (#4561)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
Didrik Nordström 2022-07-03 17:33:08 -07:00 committed by GitHub
parent e046e04c63
commit 34879f7344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Emits RunEvent::Exit prior to killing child processes managed by Tauri, allowing graceful shutdown of sidecar binaries.

View File

@ -731,13 +731,13 @@ impl<R: Runtime> App<R> {
let manager = self.manager.clone();
self.runtime.take().unwrap().run(move |event| match event {
RuntimeRunEvent::Exit => {
app_handle.cleanup_before_exit();
on_event_loop_event(
&app_handle,
RuntimeRunEvent::Exit,
&manager,
Some(&mut callback),
);
app_handle.cleanup_before_exit();
}
_ => {
on_event_loop_event(&app_handle, event, &manager, Some(&mut callback));