From 9c65abce1bd3895b7f8d9d4d8a449ac4802fce24 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Mon, 7 Mar 2022 10:08:19 -0300 Subject: [PATCH] feat(core): run cleanup code on the relaunch API (#3629) --- .changes/api-relaunch-cleanup.md | 5 +++++ core/tauri/src/endpoints/process.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/api-relaunch-cleanup.md diff --git a/.changes/api-relaunch-cleanup.md b/.changes/api-relaunch-cleanup.md new file mode 100644 index 000000000..825658a3e --- /dev/null +++ b/.changes/api-relaunch-cleanup.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Run `AppHandle` cleanup code before restarting the application on the `process > relaunch` API. diff --git a/core/tauri/src/endpoints/process.rs b/core/tauri/src/endpoints/process.rs index 5d16b2a33..8383eca0d 100644 --- a/core/tauri/src/endpoints/process.rs +++ b/core/tauri/src/endpoints/process.rs @@ -23,7 +23,7 @@ pub enum Cmd { impl Cmd { #[module_command_handler(process_relaunch, "process > relaunch")] fn relaunch(context: InvokeContext) -> super::Result<()> { - crate::api::process::restart(&context.window.state()); + context.window.app_handle().restart(); Ok(()) }