void wxCocoaNSWindow::AssociateNSWindow(WX_NSWindow cocoaNSWindow)
{
- [cocoaNSWindow setReleasedWhenClosed: NO];
- sm_cocoaHash.insert(wxCocoaNSWindowHash::value_type(cocoaNSWindow,this));
+ if(cocoaNSWindow)
+ {
+ [cocoaNSWindow setReleasedWhenClosed: NO];
+ sm_cocoaHash.insert(wxCocoaNSWindowHash::value_type(cocoaNSWindow,this));
+ }
}
// ============================================================================