Make glContext a local variable, it is not needed outside the function

where it is allocated, reference counting takes care of freeing it.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29617 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-09-01 21:16:58 +00:00
parent 9ad17fad92
commit 1b3c42472d
2 changed files with 2 additions and 3 deletions

View File

@ -40,7 +40,6 @@
{
//Cocoa
NSWindow *window;
NSOpenGLContext *glContext;
NSEvent *event;
//CoreVideo

View File

@ -436,6 +436,7 @@ static int control(uint32_t request, void *data, ...)
@implementation MPlayerOpenGLView
- (void) preinit
{
NSOpenGLContext *glContext;
GLint swapInterval = 1;
CVReturn error;
@ -464,6 +465,7 @@ static int control(uint32_t request, void *data, ...)
[glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
[glContext setView:self];
[glContext makeCurrentContext];
[glContext release];
error = CVOpenGLTextureCacheCreate(NULL, 0, [glContext CGLContextObj], [[self pixelFormat] CGLPixelFormatObj], 0, &textureCache);
if(error != kCVReturnSuccess)
@ -486,8 +488,6 @@ static int control(uint32_t request, void *data, ...)
CVOpenGLTextureCacheRelease(textureCache);
textureCache = NULL;
[self setOpenGLContext:nil];
[glContext release];
glContext = NULL;
[super dealloc];
}