X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da0634c1401743089b1d8be20f9b6bdad0e8085b..4c7020e9f5df00af0c0fe51e669cfffd5a2c3b3e:/src/cocoa/bmpbuttn.mm diff --git a/src/cocoa/bmpbuttn.mm b/src/cocoa/bmpbuttn.mm index 94b40d9160..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; @@ -52,8 +55,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid, wxBitmapButton::~wxBitmapButton() { - CocoaRemoveFromParent(); - SetNSButton(NULL); + DisassociateNSButton(m_cocoaNSView); } void wxBitmapButton::Cocoa_wxNSButtonAction(void)