diff --git a/.changes/fix-clear-browsing-data-macos.md b/.changes/fix-clear-browsing-data-macos.md new file mode 100644 index 000000000..aae36ae33 --- /dev/null +++ b/.changes/fix-clear-browsing-data-macos.md @@ -0,0 +1,5 @@ +--- +"wry": patch +--- + +Fixes `WebView::clear_all_browsing_data` crashing with a segfault on macOS. diff --git a/src/wkwebview/mod.rs b/src/wkwebview/mod.rs index 01a0d3477..752211a48 100644 --- a/src/wkwebview/mod.rs +++ b/src/wkwebview/mod.rs @@ -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(())