[webkit-reviews] review granted: [Bug 89434] [Mac] -[WebPDFView _menuItemsFromPDFKitForEvent:] leaks NSMenuItems : [Attachment 148263] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 19 08:30:22 PDT 2012


Darin Adler <darin at apple.com> has granted Andy Estes <aestes at apple.com>'s
request for review:
Bug 89434: [Mac] -[WebPDFView _menuItemsFromPDFKitForEvent:] leaks NSMenuItems
https://bugs.webkit.org/show_bug.cgi?id=89434

Attachment 148263: Patch
https://bugs.webkit.org/attachment.cgi?id=148263&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=148263&action=review


>> Source/WebKit/mac/WebView/WebPDFView.mm:1153
>> +	    [copiedItems addObject:itemCopy.get()];
> 
> The RetainPtr seems overkill. You can just immediately release itemCopy after
adding it to the copiedItems array, and rely on the items presence in the array
to keep it alive for as long as we are dealing with it.

I like Mark’s suggestion, but this change is also OK as is.


More information about the webkit-reviews mailing list