From 717081a7cdd47952e970dce72931e7c006f19d55 Mon Sep 17 00:00:00 2001 From: Sascha Hlusiak Date: Tue, 5 Jan 2021 15:10:32 +0800 Subject: [PATCH] fix: extra child traversal in collectDirtyChildren to cause app to hang when saving object with many pointers --- Parse/Parse/Source/PFObject.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Parse/Parse/Source/PFObject.m b/Parse/Parse/Source/PFObject.m index 48c24a801..6af002e17 100644 --- a/Parse/Parse/Source/PFObject.m +++ b/Parse/Parse/Source/PFObject.m @@ -211,7 +211,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 { @@ -292,7 +292,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, @@ -334,7 +334,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];