X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb45bb1fb231dd982d5196766dbca2ce161c0ea4..f3e28ade43cf9d6bd1c158280939870249cc9d2a:/src/cocoa/NSWindow.mm diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index c0a6fdba0e..d230b1a093 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -35,8 +35,11 @@ WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSWindow) 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)); + } } // ============================================================================