Skip to content

avoid crash - #37

Open
kirayamato1989 wants to merge 2 commits into
matthewpalmer:masterfrom
kirayamato1989:master
Open

avoid crash#37
kirayamato1989 wants to merge 2 commits into
matthewpalmer:masterfrom
kirayamato1989:master

Conversation

@kirayamato1989

Copy link
Copy Markdown

when an error occur the giftGroup will been leaved, but the loop will continue. Finally at the last time the code will be execute giftGroup.leave() this will crash

@ignotusverum ignotusverum mentioned this pull request Oct 28, 2017
Comment thread Regift/Regift.swift Outdated
guard let imageRef = image , error == nil else {
print("An error occurred: \(error), image is \(image)")
dispatchError = true
gifGroup.leave()

@nakajijapan nakajijapan Oct 29, 2017

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that gifGroup.leave()'s position isn't good. In this case, leave is called only if an error doesn't occur. We should call leave every cases.

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.

2 participants