]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/menuitem.mm
multilib mode
[wxWidgets.git] / src / cocoa / menuitem.mm
index e5cae2430e459cfa5976d58765381daec7e51179..5b7882191849dfd630727dcdb42c4f981f141953 100644 (file)
@@ -26,6 +26,7 @@
 #endif
 
 #include "wx/cocoa/ObjcPose.h"
 #endif
 
 #include "wx/cocoa/ObjcPose.h"
+#include "wx/cocoa/autorelease.h"
 
 #import <AppKit/NSMenuItem.h>
 #import <AppKit/NSMenu.h>
 
 #import <AppKit/NSMenuItem.h>
 #import <AppKit/NSMenu.h>
@@ -92,6 +93,7 @@ wxMenuItemCocoa::wxMenuItemCocoa(wxMenu *pParentMenu,
                        wxMenu *pSubMenu)
           : wxMenuItemBase(pParentMenu, itemid, strName, strHelp, kind, pSubMenu)
 {
                        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));
     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));