diff --git a/webrtc/modules/video_render/mac/cocoa_render_view.mm b/webrtc/modules/video_render/mac/cocoa_render_view.mm index 567d171f11..19dcdebc41 100644 --- a/webrtc/modules/video_render/mac/cocoa_render_view.mm +++ b/webrtc/modules/video_render/mac/cocoa_render_view.mm @@ -19,7 +19,7 @@ using namespace webrtc; -(void)initCocoaRenderView:(NSOpenGLPixelFormat*)fmt{ - self = [super initWithFrame:[self frame] pixelFormat:[fmt autorelease]]; + self = [super initWithFrame:[self frame] pixelFormat:fmt]; if (self == nil){ WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, 0, "%s:%d Could not create instance", __FUNCTION__, __LINE__); @@ -39,7 +39,7 @@ using namespace webrtc; NSRect screenRect = [[NSScreen mainScreen]frame]; // [_windowRef setFrame:screenRect]; // [_windowRef setBounds:screenRect]; - self = [super initWithFrame:screenRect pixelFormat:[fmt autorelease]]; + self = [super initWithFrame:screenRect pixelFormat:fmt]; if (self == nil){ WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, 0, "%s:%d Could not create instance", __FUNCTION__, __LINE__); diff --git a/webrtc/modules/video_render/mac/video_render_nsopengl.mm b/webrtc/modules/video_render/mac/video_render_nsopengl.mm index c83ba23b58..3410da0039 100644 --- a/webrtc/modules/video_render/mac/video_render_nsopengl.mm +++ b/webrtc/modules/video_render/mac/video_render_nsopengl.mm @@ -556,7 +556,8 @@ int VideoRenderNSOpenGL::setRenderTargetWindow() 0 }; - NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*) attribs]; + NSOpenGLPixelFormat* fmt = [[[NSOpenGLPixelFormat alloc] initWithAttributes: + (NSOpenGLPixelFormatAttribute*) attribs] autorelease]; if(_windowRef) { @@ -568,8 +569,6 @@ int VideoRenderNSOpenGL::setRenderTargetWindow() return -1; } - [fmt release]; - _nsglContext = [_windowRef nsOpenGLContext]; [_nsglContext makeCurrentContext]; @@ -597,7 +596,8 @@ int VideoRenderNSOpenGL::setRenderTargetFullScreen() 0 }; - NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*) attribs]; + NSOpenGLPixelFormat* fmt = [[[NSOpenGLPixelFormat alloc] initWithAttributes: + (NSOpenGLPixelFormatAttribute*) attribs] autorelease]; // Store original superview and frame for use when exiting full screens _windowRefSuperViewFrame = [_windowRef frame]; @@ -624,8 +624,6 @@ int VideoRenderNSOpenGL::setRenderTargetFullScreen() return -1; } - [fmt release]; - _nsglContext = [_windowRef nsOpenGLContext]; [_nsglContext makeCurrentContext];