Bug 59727 - -[WebPDFView menuForEvent:] leaks NSMenuItem objects
Summary: -[WebPDFView menuForEvent:] leaks NSMenuItem objects
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: PDF (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on: 3711
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-28 12:31 PDT by David Kilzer (:ddkilzer)
Modified: 2011-04-28 14:40 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.37 KB, patch)
2011-04-28 12:31 PDT, David Kilzer (:ddkilzer)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2011-04-28 12:31:05 PDT
Created attachment 91537 [details]
Patch

Reviewed by NOBODY (OOPS!).

* WebView/WebPDFView.mm:
(-[WebPDFView menuForEvent:]): Call -autorelease after copying
each NSMenuItem.  Regressed in r9566.
---
 2 files changed, 11 insertions(+), 1 deletions(-)
Comment 1 WebKit Review Bot 2011-04-28 12:34:06 PDT
Attachment 91537 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/mac/ChangeLog', u'Source/Web..." exit_code: 1

Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 2 David Kilzer (:ddkilzer) 2011-04-28 12:45:37 PDT
(In reply to comment #0)
> Regressed in r9566.

<http://trac.webkit.org/changeset/9566>
Comment 3 David Kilzer (:ddkilzer) 2011-04-28 12:46:37 PDT
(In reply to comment #2)
> (In reply to comment #0)
> > Regressed in r9566.
> <http://trac.webkit.org/changeset/9566>

Bug 3711!
Comment 4 Darin Adler 2011-04-28 12:48:24 PDT
Comment on attachment 91537 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=91537&action=review

> Source/WebKit/mac/WebView/WebPDFView.mm:395
> +            [menu addItem:[[menuItem copy] autorelease]];

It’s normally better to use release than autorelease. We could do that by adding a local variable.
Comment 5 David Kilzer (:ddkilzer) 2011-04-28 13:17:05 PDT
Committed r85230: <http://trac.webkit.org/changeset/85230>
Comment 6 David Kilzer (:ddkilzer) 2011-04-28 14:40:25 PDT
(In reply to comment #4)
> (From update of attachment 91537 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=91537&action=review
> 
> > Source/WebKit/mac/WebView/WebPDFView.mm:395
> > +            [menu addItem:[[menuItem copy] autorelease]];
> 
> It’s normally better to use release than autorelease. We could do that by adding a local variable.

Committed r85237: <http://trac.webkit.org/changeset/85237>