Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed6aa20

Browse files
author
Yu-Wei Wu
committed
Add change file
1 parent fde2613 commit ed6aa20

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

.changes/str-memleak.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"wry": patch
3+
---
4+
5+
Fix NSString can not be released.
6+

src/webview/wkwebview/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,12 @@ impl InnerWebView {
104104

105105
let nsstring = {
106106
let s: id = msg_send![url, absoluteString];
107-
// not need from_ptr
108107
NSString(s)
109108
};
110109

111110
// Get request method (GET, POST, PUT etc...)
112111
let method = {
113112
let s: id = msg_send![request, HTTPMethod];
114-
// not need from_ptr
115113
NSString(s)
116114
};
117115

@@ -147,7 +145,6 @@ impl InnerWebView {
147145

148146
// get all our headers values and inject them in our request
149147
for current_header_ptr in all_headers.iter() {
150-
// not need from_ptr
151148
let header_field = NSString(current_header_ptr);
152149
let header_value = NSString(all_headers.valueForKey_(current_header_ptr));
153150

@@ -322,7 +319,6 @@ impl InnerWebView {
322319
let url: id = msg_send![request, URL];
323320
let url: id = msg_send![url, absoluteString];
324321

325-
// not need from_ptr
326322
let url = NSString(url);
327323

328324
let handler = handler as *mut block::Block<(NSInteger,), c_void>;
@@ -625,7 +621,6 @@ pub fn platform_webview_version() -> Result<String> {
625621
let dict: id = msg_send![bundle, infoDictionary];
626622
let webkit_version: id = msg_send![dict, objectForKey: NSString::new("CFBundleVersion")];
627623

628-
// not need from_ptr
629624
let nsstring = NSString(webkit_version);
630625

631626
let () = msg_send![bundle, unload];

0 commit comments

Comments
 (0)