]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/bmpbuttn.mm
Remove wxBitmapHandler code
[wxWidgets.git] / src / cocoa / bmpbuttn.mm
index 94b40d916054c30835e3de3b180e1fe61e752ff3..2ae02dfdd09fa10c65756d7bfe27974c0947549b 100644 (file)
@@ -16,6 +16,8 @@
     #include "wx/log.h"
 #endif
 
+#include "wx/cocoa/autorelease.h"
+
 #import <AppKit/NSButton.h>
 #import <Foundation/NSString.h>
 
@@ -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)