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

Addresses review comment from Darin Adler.

* WebView/WebPDFView.mm:
(-[WebPDFView menuForEvent:]): Use a local variable and -release
instead of -autorelease.

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

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

Addresses review comment from Darin Adler.

* WebView/WebPDFView.mm:
(-[WebPDFView menuForEvent:]): Use a local variable and -release
instead of -autorelease.

2011-04-28 Anders Carlsson <andersca@apple.com>

Fix a thinko - separateRealmLabel is not an NSImageView.
@@ -392,7 +392,9 @@ - (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] autorelease]];
NSMenuItem *menuItemCopy = [menuItem copy];
[menu addItem:menuItemCopy];
[menuItemCopy release];
}
}

0 comments on commit af67013

Please sign in to comment.