vhesener / Closures

Swifty closures for UIKit and Foundation
MIT License
1.74k stars 146 forks source link

Memory leak #57

Open danh-geo opened 3 years ago

danh-geo commented 3 years ago

In Core.swift on line 130 there is self?.removeObserver(observer!) but I believe directly after this you should have: observer = nil

You do this currently:

self?.removeObserver(observer!)
observer = nil

for lines 136-137 and 172-173 but I think its missing in the above scenario. I notice when I use Xcode Instruments > Leaks that I see memory leaks. Adding the above removes the leaks for me.