Skip to content

Commit

Permalink
fix: avoid panic caused by window closing
Browse files Browse the repository at this point in the history
ref: tauri-apps/tauri#10546
This problem only occurs in windows

fix: update panic strategy
  • Loading branch information
oomeow committed Nov 12, 2024
1 parent 03b3dc5 commit c4c6e3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ custom-protocol = ["tauri/custom-protocol"]
verge-dev = []

[profile.release]
panic = "abort"
panic = "unwind"
codegen-units = 1
lto = true
opt-level = "s"
4 changes: 4 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ pub fn run() -> Result<()> {
} else {
&format!("{:?}", payload)
};
// TODO: ref: https://github.com/tauri-apps/tauri/issues/10546, Need to wait for tauri to fix this bug
if payload.contains("PostMessage failed ; is the messages queue full?") {
return;
}

let location = panic_info
.location()
Expand Down

0 comments on commit c4c6e3d

Please sign in to comment.