FBRetainCycleDetector icon indicating copy to clipboard operation
FBRetainCycleDetector copied to clipboard

Fix issue when object dealloc in DFS

Open zhongwuzw opened this issue 7 years ago • 1 comments

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] .

zhongwuzw avatar Mar 01 '18 02:03 zhongwuzw

+1

suxinde2009 avatar May 23 '19 02:05 suxinde2009