summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xSmartDeviceLink/SDLCarWindow.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLCarWindow.m b/SmartDeviceLink/SDLCarWindow.m
index 35cf8f6bd..537324ec6 100755
--- a/SmartDeviceLink/SDLCarWindow.m
+++ b/SmartDeviceLink/SDLCarWindow.m
@@ -174,6 +174,8 @@ NS_ASSUME_NONNULL_BEGIN
CGImageDestinationRef destination = CGImageDestinationCreateWithData(imageData, kUTTypePNG, 1, NULL);
CGImageDestinationAddImage(destination, imageRef, nil);
if (!CGImageDestinationFinalize(destination)) {
+ CFRelease(imageData);
+ CFRelease(destination);
return nil;
}
@@ -228,7 +230,6 @@ NS_ASSUME_NONNULL_BEGIN
CGContextRestoreGState(context);
UIImage* image = UIGraphicsGetImageFromCurrentImageContext();
- CGContextRelease(context);
return image;
}