From 302754d486da97a88a71a055711b2d2aaa05c6c3 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Fri, 12 May 2023 17:35:51 -0700 Subject: [PATCH] closing without waiting should still disconnect --- src-tauri/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index b746131..945e2bc 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -230,6 +230,13 @@ fn main() -> Result<(), ArgsError> { gamebanana::list_submissions, gamebanana::list_mods ]) + .on_window_event(|event| match event.event() { + tauri::WindowEvent::CloseRequested { api, .. } => { + // Ensure all proxy stuff is handled + disconnect(); + } + _ => {} + }) .run(tauri::generate_context!()) .expect("error while running tauri application"); } else {