Skip to content

Commit

Permalink
CoreFoundation memory management in RCTImageStoreManager
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Peter Argany authored and facebook-github-bot committed Nov 4, 2019
1 parent 595f5ac commit dfba312
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/Image/RCTImageStoreManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ - (id)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate
MIMEType:MIMEType
expectedContentLength:imageData.length
textEncodingName:nil];
CFRelease(UTI);

[delegate URLRequest:cancellationBlock didReceiveResponse:response];
[delegate URLRequest:cancellationBlock didReceiveData:imageData];
Expand Down

0 comments on commit dfba312

Please sign in to comment.