X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb896a322a2ed53d393ee738765ddd3f72cee004..8ce0312ea0f0c1981571cc4fff7c063e30d32d3f:/src/cocoa/dialog.mm diff --git a/src/cocoa/dialog.mm b/src/cocoa/dialog.mm index 59cf2fb0a2..635487ceeb 100644 --- a/src/cocoa/dialog.mm +++ b/src/cocoa/dialog.mm @@ -14,6 +14,8 @@ #include "wx/settings.h" #include "wx/log.h" +#include "wx/cocoa/autorelease.h" + #import #import @@ -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];