Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIContext is able to generate overly #55

Open
syjdev opened this issue May 5, 2020 · 1 comment
Open

CIContext is able to generate overly #55

syjdev opened this issue May 5, 2020 · 1 comment
Assignees
Labels
💪 enhancement New feature or request 👍 good first issue Good for newcomers 🙋‍♀️ help wanted Extra attention is needed

Comments

@syjdev
Copy link
Collaborator

syjdev commented May 5, 2020

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.

@syjdev syjdev added the 🙋‍♀️ help wanted Extra attention is needed label May 5, 2020
@tucan9389
Copy link
Owner

tucan9389 commented May 5, 2020

@syjdev

👍

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

@tucan9389 tucan9389 added 👍 good first issue Good for newcomers 💪 enhancement New feature or request labels May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request 👍 good first issue Good for newcomers 🙋‍♀️ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants