| Summary: | -[JSContext setName:] leaks NSString | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
| Component: | JavaScriptCore | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, ggaren, joepeck, mhahnenberg, timothy | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
Created attachment 233325 [details]
Patch v1
Comment on attachment 233325 [details]
Patch v1
r=me! Thanks
Comment on attachment 233325 [details] Patch v1 Clearing flags on attachment: 233325 Committed r170117: <http://trac.webkit.org/changeset/170117> All reviewed patches have been landed. Closing bug. Comment on attachment 233325 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=233325&action=review > Source/JavaScriptCore/API/JSContext.mm:200 > - JSStringRef nameJS = name ? JSStringCreateWithCFString((CFStringRef)[name copy]) : nullptr; > + JSStringRef nameJS = name ? JSStringCreateWithCFString((CFStringRef)[[name copy] autorelease]) : nullptr; Why not just remove the call to copy? There’s no need for a copy here. |
JavaScriptCore/API/JSContext.mm:200:73: warning: Potential leak of an object JSStringRef nameJS = name ? JSStringCreateWithCFString((CFStringRef)[name copy]) : nullptr; ^