pull/72/head
amrbashir 3 years ago
parent 8da0e73634
commit 10b799ab36
No known key found for this signature in database
GPG Key ID: BBD7A47A2003FF33

@ -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 {

Loading…
Cancel
Save