diff --git a/src/cocoa/dialog.mm b/src/cocoa/dialog.mm index 0b4e1a8406..b82f6f2965 100644 --- a/src/cocoa/dialog.mm +++ b/src/cocoa/dialog.mm @@ -84,7 +84,7 @@ wxDialog::~wxDialog() wxLogDebug("Destroying"); // setReleasedWhenClosed: NO [m_cocoaNSWindow close]; - DisassociateNSPanel(m_cocoaNSWindow); + DisassociateNSPanel(GetNSPanel()); } void wxDialog::Cocoa_close(void)