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

fix: Fix runAsync not properly retaining/releasing Frame #2829

Merged
merged 1 commit into from May 1, 2024

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented May 1, 2024

What

Fixes an issue that actually should've occurred always, but apparently only occurred in runAsync, where the Frame was not properly released.

Before, we manually ref-counted using _refCount, and only if we hit _refCount < 1 we set the _frame to nil.

Now, we moved incrementRefCount and decrementRefCount into Frame itself, which now uses CFRetain and CFRelease.

This seems safer as we use ARC/MRC from NS, but also it now properly executes runAsync without halting.

Changes

Tested on

Related issues

Copy link

vercel bot commented May 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview May 1, 2024 3:53pm

@mrousavy mrousavy merged commit e75bb9f into main May 1, 2024
8 checks passed
@mrousavy mrousavy deleted the feat/fix-runasync branch May 1, 2024 16:26
fahadhaque007 pushed a commit to equinoxventures/react-native-vision-science-camera that referenced this pull request May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant