-
-
Save eito/42cf5bff80f8c20d06342750ef06cb94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@objc | |
func doStuff() { | |
foo { [weak self] in | |
guard let mySelf = self else { | |
return | |
} | |
// uncomment this and this code doesn't cause a leak | |
// | |
// mySelf.barAsync { | |
// mySelf.bar() | |
// } | |
// uncomment this and the call to mySelf.bar() causes a leak | |
// | |
mySelf.settings.$isEnabled | |
.dropFirst() | |
.sink { _ in | |
mySelf.bar() | |
} | |
.store(in: &mySelf.subscriptions) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment