Deviopath › Swift

Break a Cycle

Hard · Memory

Two objects pointing at each other leak under ARC unless one link is weak. Model: cycle(weakA) returns whether both are still alive after dropping local refs. If weakA is 1, A→B is weak and both die (return 0). If 0, they leak (return 1).

Write leaks(_:).

Next: Repository Port