Resolves #12. To avoid a Segmentation Fault retains the body of a message from a webpate to a webview

This commit is contained in:
Rui A. Rebelo 2021-07-03 21:51:02 -06:00
parent aba18412cd
commit 2f7ebbf2ad

View file

@ -49,7 +49,7 @@ extern fn on_message<T: WebViewDelegate>(this: &Object, _: Sel, _: id, script_me
unsafe {
let name = NSString::from_retained(msg_send![script_message, name]);
let body = NSString::from_retained(msg_send![script_message, body]);
let body = NSString::retain(msg_send![script_message, body]);
delegate.on_message(name.to_str(), body.to_str());
}
}