Merge pull request #13 from rrebelo62/trunk

Resolves #12. Avoid Segmentation Fault, retains the body of a message from a webpage to a webview
This commit is contained in:
Ryan McGrath 2021-07-04 15:05:24 -07:00 committed by GitHub
commit 1e132d9080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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