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

Convert dispatch semaphore to group #46

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

bojanstef
Copy link
Contributor

No description provided.

@bojanstef
Copy link
Contributor Author

@piemonte please review when you have a minute. This fix is similar to #44 in the sense that the priority inversion is resolved but the functionality remains the same.

@piemonte piemonte merged commit 6f21ab1 into NextLevel:main Jan 8, 2024
@acushway
Copy link

Hi. I tried including this update in one of my apps that had been having some issues where a video would save and the file was fine but I couldn't then save that video file to the camera roll. It seemed like the file was somehow locked and updating to this code seemed to fix the problem.

However when I shipped the change the crash rate jumped and I can't make much of the stack trace other than it seems to do with the dispatch group and there is an entry in the crash keys:

crash_info_entry_0 | BUG IN CLIENT OF LIBDISPATCH: Unbalanced call to dispatch_group_leave()

I've not seen this personally but it seems to be happening to some users multiple times. This is happening on iPhone, iPad and on iOS 15/16/17

I'll look into it but just raising this for now.

@acushway
Copy link

Quick update. Seems to be happening for time lapse videos (no audio).

@acushway
Copy link

I've had a look at the code:

Line 291 and line 303 (dispatchGroup.leave()) should be removed. They allow for leaving a dispatchGroup before it has been entered.

Timelapse videos will now save again in my app.

@bojanstef
Copy link
Contributor Author

Want me to add a PR or will you? @acushway

@acushway
Copy link

If you could do it that would be great. I've worked by myself for the past 10 years and have no clue what I'm doing as far as git goes :)

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.

3 participants