1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-14 10:55:43 +00:00

properly release window

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16145 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nplourde 2005-07-28 22:19:34 +00:00
parent 6c88ce1050
commit 0712baca3d

View File

@ -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];