]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSWindow.mm
redistribution of code for different library parts
[wxWidgets.git] / src / cocoa / NSWindow.mm
index c0a6fdba0ecab677b7abf60b8b1309acabc19893..d230b1a09322037f82e0d26a6466a0b5e96c6f5d 100644 (file)
@@ -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));
+    }
 }
 
 // ============================================================================