diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-01 21:16:58 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-09-01 21:16:58 +0000 |
commit | 1b3c42472d2e088a134c1f020b2ae4de3fb3a159 (patch) | |
tree | 0f56469136b1469e25764d6823f41a3b42098bfa | |
parent | 9ad17fad92aa34edcfae05e03df4cce7b63fa1e8 (diff) | |
download | mpv-1b3c42472d2e088a134c1f020b2ae4de3fb3a159.tar.bz2 mpv-1b3c42472d2e088a134c1f020b2ae4de3fb3a159.tar.xz |
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
-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]; } |