Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macos): clear_all_browsing_data segfault with null completionHandler #1362

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/fix-clear-browsing-data-macos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Fixes `WebView::clear_all_browsing_data` crashing with a segfault on macOS.
2 changes: 1 addition & 1 deletion src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ r#"Object.defineProperty(window, 'ipc', {
let store: id = msg_send![config, websiteDataStore];
let all_data_types: id = msg_send![class!(WKWebsiteDataStore), allWebsiteDataTypes];
let date: id = msg_send![class!(NSDate), dateWithTimeIntervalSince1970: 0.0];
let handler = null::<*const c_void>();
let handler = block::ConcreteBlock::new(|| {}).copy();
let _: () = msg_send![store, removeDataOfTypes:all_data_types modifiedSince:date completionHandler:handler];
}
Ok(())
Expand Down