From dfba3129f4962bcd1fe16ba004fd315e48245806 Mon Sep 17 00:00:00 2001 From: Peter Argany Date: Mon, 4 Nov 2019 14:38:33 -0800 Subject: [PATCH] CoreFoundation memory management in RCTImageStoreManager Summary: I recently learned that CoreFoundation object lifecycle is not managed automatically by ARC. RN appears to be leaking a few refs, this small stack of diffs cleans them up. Changelog: [Internal][Fixed] Fixed memory management of CF objects in RCTImageStoreManager Reviewed By: fkgozali Differential Revision: D18308313 fbshipit-source-id: 35c1152753578825871c28e1070599cd409b3a34 --- Libraries/Image/RCTImageStoreManager.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/Image/RCTImageStoreManager.mm b/Libraries/Image/RCTImageStoreManager.mm index 60dc7cd0919..e32fc573d1d 100644 --- a/Libraries/Image/RCTImageStoreManager.mm +++ b/Libraries/Image/RCTImageStoreManager.mm @@ -178,6 +178,7 @@ RCT_EXPORT_METHOD(addImageFromBase64:(NSString *)base64String MIMEType:MIMEType expectedContentLength:imageData.length textEncodingName:nil]; + CFRelease(UTI); [delegate URLRequest:cancellationBlock didReceiveResponse:response]; [delegate URLRequest:cancellationBlock didReceiveData:imageData];