]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/dialog.mm
Stub for wxIcon constructor taking a non-const xpm
[wxWidgets.git] / src / cocoa / dialog.mm
index 59cf2fb0a2103642e2310115c207a39fe3486133..635487ceeb09aacca0ee1745227d41c89d7361d6 100644 (file)
@@ -14,6 +14,8 @@
 #include "wx/settings.h"
 #include "wx/log.h"
 
+#include "wx/cocoa/autorelease.h"
+
 #import <AppKit/NSPanel.h>
 #import <AppKit/NSApplication.h>
 
@@ -44,6 +46,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid,
            long style,
            const wxString& name)
 {
+    wxAutoNSAutoreleasePool pool;
     wxTopLevelWindows.Append(this);
 
     if(!CreateBase(parent,winid,pos,size,style,wxDefaultValidator,name))
@@ -76,7 +79,7 @@ wxDialog::~wxDialog()
     wxLogDebug("Destroying");
     // setReleasedWhenClosed: NO
     [m_cocoaNSWindow close];
-    SetNSPanel(NULL);
+    DisassociateNSPanel(m_cocoaNSWindow);
 }
 
 void wxDialog::Cocoa_close(void)
@@ -108,6 +111,7 @@ bool wxDialog::Show(bool show)
     {
         if(show)
         {
+            wxAutoNSAutoreleasePool pool;
             wxModalDialogs.Append(this);
             wxLogDebug("runModal");
             [wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow];