CIContext is able to generate overly
syjdev opened this issue · 1 comments
syjdev commented
In pixelBufferFromImage(UIImageExtension),
CIContext is generated whenever pixelBufferFromImage called.
I recommend to use shared CIContext object(But This isn't just meaning to make single-ton).
Becauase, If CIContext is generated overly then It cause memory issues(zombie object or leak).
So you should use shared CIContext object as possible.
Don't worry about to use shared CIContext object.
This object is thread safe.
tucan9389 commented
👍
Creating a CIContext is expensive, so create one during your initial setup and reuse it throughout your app.
ref: https://developer.apple.com/documentation/coreimage/processing_an_image_using_built-in_filters