X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb896a322a2ed53d393ee738765ddd3f72cee004..8ce0312ea0f0c1981571cc4fff7c063e30d32d3f:/src/cocoa/menu.mm?ds=sidebyside diff --git a/src/cocoa/menu.mm b/src/cocoa/menu.mm index 4b8dbf3153..57db00ae15 100644 --- a/src/cocoa/menu.mm +++ b/src/cocoa/menu.mm @@ -23,6 +23,8 @@ #include "wx/log.h" #endif // WX_PRECOMP +#include "wx/cocoa/autorelease.h" + #import #import @@ -53,6 +55,7 @@ wxMenu::~wxMenu() bool wxMenu::DoAppend(wxMenuItem *item) { + wxAutoNSAutoreleasePool pool; if(!wxMenuBase::DoAppend(item)) return false; [m_cocoaNSMenu addItem: item->GetNSMenuItem()]; @@ -61,6 +64,7 @@ bool wxMenu::DoAppend(wxMenuItem *item) bool wxMenu::DoInsert(unsigned long pos, wxMenuItem *item) { + wxAutoNSAutoreleasePool pool; if(!wxMenuBase::DoInsert(pos,item)) return false; [m_cocoaNSMenu insertItem:item->GetNSMenuItem() atIndex:pos]; @@ -69,6 +73,7 @@ bool wxMenu::DoInsert(unsigned long pos, wxMenuItem *item) wxMenuItem* wxMenu::DoRemove(wxMenuItem *item) { + wxAutoNSAutoreleasePool pool; wxMenuItem *retitem = wxMenuBase::DoRemove(item); wxASSERT(retitem->GetNSMenuItem()); [m_cocoaNSMenu removeItem:retitem->GetNSMenuItem()]; @@ -93,6 +98,7 @@ wxMenuBar::~wxMenuBar() bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) { + wxAutoNSAutoreleasePool pool; wxLogDebug("append menu=%p, title=%s",menu,title.c_str()); if(!wxMenuBarBase::Append(menu,title)) return false; @@ -112,6 +118,7 @@ bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { + wxAutoNSAutoreleasePool pool; wxLogDebug("insert pos=%lu, menu=%p, title=%s",pos,menu,title.c_str()); if(!wxMenuBarBase::Insert(pos,menu,title)) return false; @@ -160,10 +167,12 @@ wxString wxMenuBar::GetLabelTop(size_t pos) const void wxMenuBar::Attach(wxFrame *frame) { + wxMenuBarBase::Attach(frame); } void wxMenuBar::Detach() { + wxMenuBarBase::Detach(); } wxSize wxMenuBar::DoGetBestClientSize() const