diff options
-rw-r--r-- | libvo/vo_corevideo.h | 1 | ||||
-rw-r--r-- | libvo/vo_corevideo.m | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/libvo/vo_corevideo.h b/libvo/vo_corevideo.h index 7789aa87af..691ebe6537 100644 --- a/libvo/vo_corevideo.h +++ b/libvo/vo_corevideo.h @@ -40,7 +40,6 @@ { //Cocoa NSWindow *window; - NSOpenGLContext *glContext; NSEvent *event; //CoreVideo diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index e299a09137..099963c167 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -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]; } |