fix: single instance doesn't shutdown immediately (#1019)

* Fix single instance doesn't shutdown immediately

* Add change file
This commit is contained in:
Tony
2024-03-04 21:52:40 +08:00
committed by GitHub
parent 99bea2559c
commit 2397ec5937
3 changed files with 9 additions and 2 deletions
@@ -70,7 +70,8 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
),
);
}
std::process::exit(0)
app.cleanup_before_exit();
std::process::exit(0);
}
_ => {}
}
@@ -62,7 +62,8 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
lpData: bytes.as_ptr() as _,
};
SendMessageW(hwnd, WM_COPYDATA, 0, &cds as *const _ as _);
app.exit(0);
app.cleanup_before_exit();
std::process::exit(0);
}
}
} else {