Memory leaks / retain cycles
ejensen opened this issue · 1 comments
ejensen commented
Describe the problem
Lock's UI leaks memory. The leaks are caused by retain cycles.
What was the expected behavior?
Lock does not leak memory
Reproduction
Memory is leaked when the Lock UI is dismissed:
- Run the Lock demo app
- Present the Lock UI
- Dismiss the Lock UI
- Notice that memory is leaked
- For instance, the
Presenter
is never deallocated
- For instance, the
Presenter-leaks.mp4
Memory is leaked when switching between log in and sign up:
- Run the Lock demo app
- Present the Lock UI
- Switch between the login and sign up views
- Notice that the view's memory is leaked
- For instance, a new
CredentialsView
is created each time the login view is shown, but never deallocated
- For instance, a new
View-leaks.mp4
Can the behavior be reproduced using the included Lock.swift demo app? Yes
Environment
- Version of
Lock.swift
used: 2.21.0 - Version of iOS: 14.4
- Version of Xcode: 12.4