A developer encountered a bug where deep links caused the screen to appear twice in an iOS app. The issue was traced to a memory leak in the MyDataCoordinator, which kept old instances alive even after logging out and back in. The problem was identified using print statements and the Xcode memory graph debugger, revealing that an incorrectly placed weak self capture in a nested closure retained a strong reference. The bug was fixed by moving the weak self capture to the correct place, ensuring coordinator deallocation upon logout.
Table of contents
How Deep Linking WorksSeeking ReproLots of print statementsA memory leakWhat is a memory leak?A big, big memory leakThe name of the gameSearch and destroyDivide and conquerThe CulpritFixing the leakConclusionSort: