From: David Elliott Date: Mon, 4 Oct 2004 23:47:49 +0000 (+0000) Subject: Added wxAutoNSAutoreleasePool where needed for controls sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d1adc25737bf5c001a2218fd6d8281262a811ace Added wxAutoNSAutoreleasePool where needed for controls sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index 401e7af1f7..ba97699d8e 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -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]; } diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 7ce8c835aa..1c79b3ad67 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -15,6 +15,8 @@ #include "wx/dcmemory.h" #endif //WX_PRECOMP +#include "wx/cocoa/autorelease.h" + #import #import #import @@ -67,6 +69,7 @@ bool wxMemoryDC::CocoaUnlockFocus() // instead copy the data to an offscreen window, then copy it back void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) { + wxAutoNSAutoreleasePool pool; if(m_selectedBitmap.Ok()) { CocoaTakeFocus();