Commit 8cb00d38 authored by Tim Lammens's avatar Tim Lammens Committed by Felix Paul Kühne

macosx: fix memory leak in windowless plugin

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 7aaa8fad
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment