FBRetainCycleDetector
FBRetainCycleDetector copied to clipboard
Fix issue when object dealloc in DFS
We use the NSMutableSet to save objects when we DFS, NSMutableSet use hash to distinguish different objects, in our situation, we use FBNodeEnumerator->FBObjectiveCGraphElement->object's pointer address, but object can be dealloc anytime, refer to Apple Document and tests, we can not add mutable object to a collection.
After my tests, for example:
objectsOnPath has a FBNodeEnumerator object A, after some step when DFS, we caught A again, after that, A.object.object dealloc, A's hash is changed to 0. but objectsOnPath haven't realize that change, it leads to containsObject not accurate when we call [objectsOnPath containsObject: A] .
+1