X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42352409bcf4296029a92187db7139f006581b5d..cd9a8d40c9a7380f7fefe676cbe01089833cdd60:/src/cocoa/choice.mm diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index 3dd3ae306b..e5c2431dc8 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -6,10 +6,13 @@ // Created: 2003/03/16 // RCS-ID: $Id: // Copyright: (c) 2003 David Elliott -// Licence: wxWindows license +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" + +#if wxUSE_CHOICE + #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/app.h" @@ -18,6 +21,7 @@ #endif //WX_PRECOMP #include "wx/cocoa/string.h" +#include "wx/cocoa/autorelease.h" #import #import @@ -56,6 +60,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID winid, const wxValidator& validator, const wxString& name) { + wxAutoNSAutoreleasePool pool; if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; @@ -158,6 +163,7 @@ int wxChoice::GetCount() const wxString wxChoice::GetString(int n) const { + wxAutoNSAutoreleasePool pool; return wxStringWithNSString([(NSPopUpButton*)m_cocoaNSView itemTitleAtIndex:n]); } @@ -180,6 +186,7 @@ int wxChoice::GetSelection() const int wxChoice::DoAppend(const wxString& title) { + wxAutoNSAutoreleasePool pool; NSMenu *nsmenu = [(NSPopUpButton*)m_cocoaNSView menu]; NSMenuItem *item; if(m_sortedStrings) @@ -232,6 +239,8 @@ wxClientData* wxChoice::DoGetItemClientObject(int n) const void wxChoice::SetSelection(int n) { + wxAutoNSAutoreleasePool pool; [(NSPopUpButton*)m_cocoaNSView selectItemAtIndex:n]; } +#endif