From 10b799ab36709bead8a358e22ae1ab0c8070d7b5 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Tue, 13 Sep 2022 12:36:05 +0200 Subject: [PATCH] chore: fmt --- .changes/fix-win-dangling.md | 5 ----- src/platform_impl/windows.rs | 9 ++------- 2 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 .changes/fix-win-dangling.md diff --git a/.changes/fix-win-dangling.md b/.changes/fix-win-dangling.md deleted file mode 100644 index 12c20398..00000000 --- a/.changes/fix-win-dangling.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-plugin-single-instance": patch ---- - -fix dangling pointers caused by passing `encode_wide().as_ptr()` directly to FFI on Windows. \ No newline at end of file diff --git a/src/platform_impl/windows.rs b/src/platform_impl/windows.rs index 3c92695e..a4eadab4 100644 --- a/src/platform_impl/windows.rs +++ b/src/platform_impl/windows.rs @@ -35,13 +35,8 @@ pub fn init(f: Box>) -> TauriPlugin { let window_name = encode_wide(format!("{}-siw", id)); let mutex_name = encode_wide(format!("{}-sim", id)); - let hmutex = unsafe { - CreateMutexW( - std::ptr::null(), - true.into(), - mutex_name.as_ptr(), - ) - }; + let hmutex = + unsafe { CreateMutexW(std::ptr::null(), true.into(), mutex_name.as_ptr()) }; if unsafe { GetLastError() } == ERROR_ALREADY_EXISTS { unsafe {