From 0712baca3d34d6d5d3db924e92fe34d7ed688acf Mon Sep 17 00:00:00 2001 From: nplourde Date: Thu, 28 Jul 2005 22:19:34 +0000 Subject: [PATCH] properly release window git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16145 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_macosx.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m index 5523777a90..37835520e8 100644 --- a/libvo/vo_macosx.m +++ b/libvo/vo_macosx.m @@ -134,6 +134,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32 //config OpenGL View [mpGLView config]; + [mpGLView reshape]; return 0; } @@ -244,8 +245,13 @@ static uint32_t preinit(const char *arg) 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 @@ static uint32_t control(uint32_t request, void *data, ...) styleMask:NSTitledWindowMask|NSTexturedBackgroundWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO]; + [window autorelease]; [window setDelegate:mpGLView]; [window setContentView:mpGLView]; [window setInitialFirstResponder:mpGLView];