From 0621382d5f0cd5e9abd4f81b1ce1fb45ff0da40c Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 3 Aug 2023 15:45:09 -0300 Subject: [PATCH] fix macos --- core/tauri/src/app.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index b56ed43dd472..53e20b1daff2 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -669,7 +669,8 @@ macro_rules! shared_app_impl { /// this will remove the menu from it. #[cfg(desktop)] pub fn remove_menu(&self) -> crate::Result>> { - if self.manager.menu_lock().is_some() { + let menu = self.manager.menu_lock().as_ref().cloned(); + if let Some(menu) = menu { // remove from windows that have the app-wide menu #[cfg(not(target_os = "macos"))] { @@ -691,9 +692,8 @@ macro_rules! shared_app_impl { // remove app-wide for macos #[cfg(target_os = "macos")] { - let menu_ = menu.clone(); self.run_on_main_thread(move || { - menu_.inner().remove_for_nsapp(); + menu.inner().remove_for_nsapp(); })?; } }