-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(macos): Prevent NSExceptions when dropping a webview with registe…
…red protocols (#1215) * fix(macos): Prevent NSExceptions when dropping a webview with registered protocols fixes tauri-apps/tauri#7898 * use counter and hashset * retain -> remove * Update mod.rs * that's what you get from not walking 3 steps to get your macbook
- Loading branch information
1 parent
44cb683
commit 3e3d59c
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wry": patch | ||
--- | ||
|
||
On macOS, prevent NSExceptions and invalid memory access panics when dropping the WebView while custom protocols handlers may still be running. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2020-2023 Tauri Programme within The Commons Conservancy | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-License-Identifier: MIT | ||
|
||
use std::sync::atomic::{AtomicU32, Ordering}; | ||
|
||
pub struct Counter(AtomicU32); | ||
|
||
impl Counter { | ||
#[allow(unused)] | ||
pub const fn new() -> Self { | ||
Self(AtomicU32::new(1)) | ||
} | ||
|
||
pub fn next(&self) -> u32 { | ||
self.0.fetch_add(1, Ordering::Relaxed) | ||
} | ||
} |