X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb896a322a2ed53d393ee738765ddd3f72cee004..0425151023593cb31da0ee0a652da173ca9abfde:/src/cocoa/menuitem.mm?ds=sidebyside diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index e5cae2430e..5b78821918 100644 --- a/src/cocoa/menuitem.mm +++ b/src/cocoa/menuitem.mm @@ -26,6 +26,7 @@ #endif #include "wx/cocoa/ObjcPose.h" +#include "wx/cocoa/autorelease.h" #import #import @@ -92,6 +93,7 @@ wxMenuItemCocoa::wxMenuItemCocoa(wxMenu *pParentMenu, wxMenu *pSubMenu) : wxMenuItemBase(pParentMenu, itemid, strName, strHelp, kind, pSubMenu) { + wxAutoNSAutoreleasePool pool; NSString *menuTitle = [[NSString alloc] initWithCString: wxStripMenuCodes(strName).c_str()]; m_cocoaNSMenuItem = [[NSMenuItem alloc] initWithTitle:menuTitle action:@selector(wxMenuItemAction:) keyEquivalent:@""]; sm_cocoaHash.insert(wxMenuItemCocoaHash::value_type(m_cocoaNSMenuItem,this));