Skip to content
Permalink
Browse files
<http://webkit.org/b/59727> -[WebPDFView menuForEvent:] leaks NSMenuI…
…tem objects

Reviewed by Dan Bernstein.

* WebView/WebPDFView.mm:
(-[WebPDFView menuForEvent:]): Call -autorelease after copying
each NSMenuItem.  Regressed in r9566 for Bug 3711.

Canonical link: https://commits.webkit.org/74941@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ddkilzer committed Apr 28, 2011
1 parent 031a127 commit 58ac066b9ef8871210332389a98c0e6e261650d6
Showing with 11 additions and 1 deletion.
  1. +10 −0 Source/WebKit/mac/ChangeLog
  2. +1 −1 Source/WebKit/mac/WebView/WebPDFView.mm
@@ -1,3 +1,13 @@
2011-04-28 David Kilzer <ddkilzer@apple.com>

<http://webkit.org/b/59727> -[WebPDFView menuForEvent:] leaks NSMenuItem objects

Reviewed by Dan Bernstein.

* WebView/WebPDFView.mm:
(-[WebPDFView menuForEvent:]): Call -autorelease after copying
each NSMenuItem. Regressed in r9566 for Bug 3711.

2011-04-28 Enrica Casucci <enrica@apple.com>

Reviewed by Beth Dakin.
@@ -392,7 +392,7 @@ - (NSMenu *)menuForEvent:(NSEvent *)theEvent
while ((menuItem = [e nextObject]) != nil) {
// copy menuItem since a given menuItem can be in only one menu at a time, and we don't
// want to mess with the menu returned from PDFKit.
[menu addItem:[menuItem copy]];
[menu addItem:[[menuItem copy] autorelease]];
}
}

0 comments on commit 58ac066

Please sign in to comment.