Skip to content

Commit

Permalink
Fix extra child traversal in collectDirtyChildren to cause app to han…
Browse files Browse the repository at this point in the history
…g when saving object with many pointers
  • Loading branch information
shlusiak committed Jan 7, 2021
1 parent 9771d1f commit 1f26e35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Parse/Parse/PFObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ + (BFTask *)_enqueue:(BFTask *(^)(BFTask *toAwait))taskStart forObjects:(NSArray
+ (BOOL)collectDirtyChildren:(id)node
children:(NSMutableSet *)dirtyChildren
files:(NSMutableSet *)dirtyFiles
seen:(NSSet *)seen
seen:(NSMutableSet *)seen
seenNew:(NSSet *)seenNew
currentUser:(PFUser *)currentUser
error:(NSError * __autoreleasing *)error {
Expand Down Expand Up @@ -288,7 +288,7 @@ + (BOOL)collectDirtyChildren:(id)node
if ([seen containsObject:object]) {
return YES;
}
seen = [seen setByAddingObject:object];
[seen addObject:object];

// Recurse into this object's children looking for dirty children.
// We only need to look at the child object's current estimated data,
Expand Down Expand Up @@ -330,7 +330,7 @@ + (BOOL)collectDirtyChildren:(id)child
return [self collectDirtyChildren:child
children:dirtyChildren
files:dirtyFiles
seen:[NSSet set]
seen:[NSMutableSet set]
seenNew:[NSSet set]
currentUser:currentUser
error:error];
Expand Down

0 comments on commit 1f26e35

Please sign in to comment.