diff --git a/src/cocoa/bmpbuttn.mm b/src/cocoa/bmpbuttn.mm index 9245d118c0..2ae02dfdd0 100644 --- a/src/cocoa/bmpbuttn.mm +++ b/src/cocoa/bmpbuttn.mm @@ -16,6 +16,8 @@ #include "wx/log.h" #endif +#include "wx/cocoa/autorelease.h" + #import #import @@ -29,6 +31,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { + wxAutoNSAutoreleasePool pool; wxLogDebug("Creating control with id=%d",winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false;