Closed Oschly closed 3 years ago
Window's reference is nil at a time of pass passing it to the closure 🤦🏻♂️
For a time of fixing it, I'll close this PR
Issue fixed by calling removeObserver
on each of observers in WindowObserver.
Sweet thankyou for spotting this.
makeUIView(context:)
inHostingWindowFinder
has a weak reference to a newUIView
instance, which causes memory leak (shown on image below) when window with view that has.observeWindow()
modifier is deinitialized (closed).Declaring window as separated property, then passing it to the closure looks like a valid fix for that issue (closing window is marked with a gray vertical mark on image below).