From b55dcbe0af36b7cdb262cd046d09359243811ef6 Mon Sep 17 00:00:00 2001 From: Wenjing Wang Date: Thu, 28 Jan 2016 14:24:01 -0800 Subject: [PATCH] Fix CPU spike: should use UIGraphicsEndImageContext rather than UIGraphicsGetCurrentContext Summary: should use UIGraphicsEndImageContext rather than UIGraphicsGetCurrentContext public Reviewed By: nicklockwood, chaceliang Differential Revision: D2875657 fb-gh-sync-id: 0fa059e2da3d0bb1ffe5fe50a1bdaeddafc2bbfa --- Libraries/Image/RCTImageUtils.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Image/RCTImageUtils.m b/Libraries/Image/RCTImageUtils.m index a89872508..edc1cb926 100644 --- a/Libraries/Image/RCTImageUtils.m +++ b/Libraries/Image/RCTImageUtils.m @@ -321,7 +321,7 @@ UIImage *__nullable RCTTransformImage(UIImage *image, CGContextConcatCTM(currentContext, transform); [image drawAtPoint:CGPointZero]; UIImage *result = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsGetCurrentContext(); + UIGraphicsEndImageContext(); return result; }