Skip to content

Commit

Permalink
remove a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyoo committed Jan 14, 2022
1 parent 030ee0d commit a8ba000
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src-tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,14 @@ pub fn crete_pid_file() {
pub fn lock_single() {
unsafe {
let _ = OpenMutexW(0, true, "bs_redis_desktop_client@fuyoo");
if let WIN32_ERROR(code) = GetLastError() {
if code == 2 {
// 创建锁
let _ = CreateMutexW(null(),true,"bs_redis_desktop_client@fuyoo");
} else {
// 已经存在了,退出
send_wake_up();
std::process::exit(0);
}
let WIN32_ERROR(code) = GetLastError();
if code == 2 {
// 创建锁
let _ = CreateMutexW(null(),true,"bs_redis_desktop_client@fuyoo");
} else {
// 已经存在了,退出
send_wake_up();
std::process::exit(0);
}
}
}
Expand Down

0 comments on commit a8ba000

Please sign in to comment.