Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macos: break reference cycle to window to allow window to free memory
Fixes #366 The comment in the Swift code explains what was happening here: > I don't know if this is the right place, but because of WindowAccessor in our > SwiftUI hierarchy, we have a reference cycle between view and window and windows > are never freed. When the window is closed, the window controller is deinitialized, > so we can use this opportunity detach the view from the window and break the cycle. An alternate solution would be to make our reference back to the window "weak" but we appear to not be able to do that with SwiftUI property wrappers such as `@State` and `@Binding` and so on.
- Loading branch information