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

The callbacksForURL: method in SDWebImageDownloader should return a copy of the mutable array! #471

Merged
merged 1 commit into from
Aug 13, 2013

Conversation

kevincador
Copy link

Since the callback array is used for fast enumeration and could be mutated via removeCallbacksForURL, a copy of the mutable array should be returned instead of the mutable array reference. It is also a recommendation since the method signature indicates the return type as NSArray.

This should fix the crash in multithread environment such as:
"Collection <__NSArrayM: 0x226d9310> was mutated while being enumerated."

This should fix the #470 issue.

…ied array. This should fix the crash in multithread environment such as:

Collection <__NSArrayM: 0x226d9310> was mutated while being enumerated.
rs pushed a commit that referenced this pull request Aug 13, 2013
The callbacksForURL: method in SDWebImageDownloader should return a copy of the mutable array!
@rs rs merged commit 9f1ac24 into SDWebImage:master Aug 13, 2013
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