Files
react-native/ReactCommon/fabric/graphics/platform
Samuel Susla 485475ab3e Use CGColorRelease instead of CGRelease
Summary:
Changelog: [Internal]

`CFRelease` crashes app if `cf` is `NULL`, `CGColorRelease` doesn't.

From:
https://developer.apple.com/documentation/coregraphics/1586340-cgcolorrelease?language=objc#

Even though this hasn't happened yet, we had a similar crash in D21943011. Also `CGColorCreate` returns nullable so it could happen.
In order to prevent this in the future, let's switch to `CGColorRelease` which doesn't crash if `cf` is `NULL` and also is semantically correct.

Reviewed By: shergin

Differential Revision: D21953404

fbshipit-source-id: 8b969ee345c2507fcba2442fa20e3fdaf2235d8c
2020-06-09 12:20:58 -07:00
..