changeset 16144:6ea7c0735fce

properly release window
author nplourde
date Thu, 28 Jul 2005 22:19:34 +0000
parents 8ece260ce923
children b010355f31dc
files libvo/vo_macosx.m
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_macosx.m	Thu Jul 28 21:00:41 2005 +0000
+++ b/libvo/vo_macosx.m	Thu Jul 28 22:19:34 2005 +0000
@@ -134,6 +134,7 @@
 		
 	//config OpenGL View
 	[mpGLView config];
+	[mpGLView reshape];
 	
 	return 0;
 }
@@ -244,8 +245,13 @@
 	autoreleasepool = [[NSAutoreleasePool alloc] init];
 	NSApp = [NSApplication sharedApplication];
 	
-	mpGLView = [[MPlayerOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, 0, 0) pixelFormat:[MPlayerOpenGLView defaultPixelFormat]];
-	[mpGLView autorelease];
+	if(!mpGLView)
+	{
+		mpGLView = [[MPlayerOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) pixelFormat:[MPlayerOpenGLView defaultPixelFormat]];
+		[mpGLView autorelease];
+	}
+	
+	[mpGLView display];
 	[mpGLView preinit];
 	
     return 0;
@@ -281,6 +287,7 @@
 								styleMask:NSTitledWindowMask|NSTexturedBackgroundWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask
 								backing:NSBackingStoreBuffered defer:NO];
 
+	[window autorelease];
 	[window setDelegate:mpGLView];
 	[window setContentView:mpGLView];
 	[window setInitialFirstResponder:mpGLView];