From 58f6c52cfe881e59b3a808f7a797afe32728d3f9 Mon Sep 17 00:00:00 2001 From: Jason Stallings Date: Mon, 9 May 2016 22:15:26 -0500 Subject: [PATCH] Release mode and pixEnc. --- src/screengrab.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/screengrab.c b/src/screengrab.c index 8061b6c0..2e41d5af 100644 --- a/src/screengrab.c +++ b/src/screengrab.c @@ -37,6 +37,9 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRect rect) else if(CFStringCompare(pixEnc, CFSTR(IO8BitIndexedPixels), kCFCompareCaseInsensitive) == kCFCompareEqualTo) depth = 8; + CGDisplayModeRelease(mode); + CFRelease(pixEnc); + bitsPerPixel = (uint8_t) depth; bytesPerPixel = bitsPerPixel / 8; /* Align width to padding. */