[vlc-devel] [PATCH] macosx: fix memory leak in windowless plugin

Jean-Baptiste Kempf jb at videolan.org
Sat Jan 25 16:47:45 CET 2014


Seems good.


On 25 Jan, Tim Lammens wrote :
> ---
>  npapi/vlcwindowless_mac.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/npapi/vlcwindowless_mac.cpp b/npapi/vlcwindowless_mac.cpp
> index 8c75aae..26da75a 100644
> --- a/npapi/vlcwindowless_mac.cpp
> +++ b/npapi/vlcwindowless_mac.cpp
> @@ -207,6 +207,7 @@ bool VlcWindowlessMac::handle_event(void *event)
>                                        kCGRenderingIntentPerceptual);
>  
>              CGDataProviderRelease(dataProvider);
> +            CFRelease(dataRef);
>  
>              if (!lastFrame) {
>                  fprintf(stderr, "image creation failed\n");
> @@ -223,7 +224,10 @@ bool VlcWindowlessMac::handle_event(void *event)
>              rect = CGRectMake(left, top, cached_width, cached_width);
>          }
>  
> -        CGContextDrawImage(cgContext, rect, lastFrame);
> +        if(lastFrame) {
> +            CGContextDrawImage(cgContext, rect, lastFrame);
> +            CGImageRelease(lastFrame);
> +        }
>  
>          CGContextRestoreGState(cgContext);
>  
> -- 
> 1.8.3.4 (Apple Git-47)
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list