X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42352409bcf4296029a92187db7139f006581b5d..0c9240349409c7dc9e9dba96cef0acd945b607f3:/src/cocoa/choice.mm?ds=sidebyside diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index 3dd3ae306b..ba97699d8e 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -6,7 +6,7 @@ // Created: 2003/03/16 // RCS-ID: $Id: // Copyright: (c) 2003 David Elliott -// Licence: wxWindows license +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -18,6 +18,7 @@ #endif //WX_PRECOMP #include "wx/cocoa/string.h" +#include "wx/cocoa/autorelease.h" #import #import @@ -56,6 +57,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 +160,7 @@ int wxChoice::GetCount() const wxString wxChoice::GetString(int n) const { + wxAutoNSAutoreleasePool pool; return wxStringWithNSString([(NSPopUpButton*)m_cocoaNSView itemTitleAtIndex:n]); } @@ -232,6 +235,7 @@ wxClientData* wxChoice::DoGetItemClientObject(int n) const void wxChoice::SetSelection(int n) { + wxAutoNSAutoreleasePool pool; [(NSPopUpButton*)m_cocoaNSView selectItemAtIndex:n]; }