mirror of
https://github.com/tauri-apps/tauri-plugin-single-instance.git
synced 2026-02-04 02:41:18 +01:00
chore: fmt
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"tauri-plugin-single-instance": patch
|
||||
---
|
||||
|
||||
fix dangling pointers caused by passing `encode_wide().as_ptr()` directly to FFI on Windows.
|
||||
@@ -35,13 +35,8 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user