src/video/cocoa/SDL_cocoawindow.m
changeset 6185 b91e7565e877
parent 6138 4c64952a58fb
child 6231 5eecf59b698f
--- a/src/video/cocoa/SDL_cocoawindow.m	Sun Jan 08 00:36:32 2012 -0500
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Jan 08 00:39:41 2012 -0500
@@ -526,9 +526,13 @@
     /* Fill in the SDL window with the window data */
     {
         NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
-        NSView *contentView = [[SDLView alloc] initWithFrame:rect];
-        [nswindow setContentView: contentView];
-        [contentView release];
+        NSView *contentView = [ nswindow contentView ];
+        /* Create view if not already exists */
+        if (!contentView) {
+            contentView = [[SDLView alloc] initWithFrame:rect];
+            [nswindow setContentView: contentView];
+            [contentView release];
+        }
 
         ConvertNSRect(&rect);
         window->x = (int)rect.origin.x;