summaryrefslogtreecommitdiff
path: root/src/plugins/platforms/cocoa/qcocoamenu.mm
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-04-17 11:27:43 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-18 15:31:29 +0200
commitb381581579e2e49f5f8211bf4260a141e0642cd2 (patch)
tree4b5fb42375a4359ce29ea8f9b1e1c3e4e9f1d8af /src/plugins/platforms/cocoa/qcocoamenu.mm
parent2bd846f8da8c6e8c61539f2cc986df4602e5d80e (diff)
downloadqtbase-b381581579e2e49f5f8211bf4260a141e0642cd2.tar.gz
Mac: Fix various memory leaks
Change-Id: Id554be11ffcf9a506c217b0dc5b96cb37c4dd57c Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenu.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 732851ecf7..bde9ded14f 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -323,7 +323,8 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf
// typical use-case for a choice list, or non-editable combobox. We can't
// re-use the popUpContextMenu:withEvent:forView: logic below since it won't
// respect the menu's minimum width.
- NSPopUpButtonCell *popupCell = [[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO];
+ NSPopUpButtonCell *popupCell = [[[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO]
+ autorelease];
[popupCell setAltersStateOfSelectedItem:NO];
[popupCell setTransparent:YES];
[popupCell setMenu:m_nativeMenu];
@@ -350,7 +351,6 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf
eventNumber:0
clickCount:1
pressure:1.0];
- NSSize size = m_nativeMenu.size;
[NSMenu popUpContextMenu:m_nativeMenu withEvent:menuEvent forView:view];
}