Further attempts at squashing the catalog scanning crash #1321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this has now just become a competition between me and skurfer to see who can create the most commits that are redundant ;-)
I think I'm winning atm :D
From #1319:
Nooooooooo!
Looks like this still isn't fixed, 4 crash logs this morning. :(
How is this possible!?
I think perhaps the problem was with the
dispatch_async
call insaveIndex
. I've changed it around slightly now so it only usesdispatch_sync
, and if it's being called on thescanQueue
queue, then it won't bother trying to add it to thescanQueue
again. (If I'm correct,dispatch_async
will make a 'copy' of the code/iVars etc. when it's called and add them to memory for when the block can be run, whereasdispatch_sync
will wait until the block can be run then make a copy of the code/iVars, so potentially the iVars in the two blocks could be different.I've also added
__block
to theindexDate
iVar. I remember @skurfer mentioned something about not having to do this if you're using setters, but I couldn't remember the reason why, and I think it's better to be safeThis is a fun exercise right? :D