Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app: [macOS] send ViewEvents when the NSView is attached to a NSWindow
Instead of sending ViewEvents once at construction and once at destruction, it's better to send them when the underlying NSView changes attachment. The main advantage is that we're about to move the destruction and emitting of DestroyEvent to the NSView's dealloc method. However, the dealloc will not be called if user code has a strong reference to it through a non-empty ViewEvent. By sending an empty ViewEvent when the view is detached, well-behaving users will remove the strong reference. Signed-off-by: Elias Naur <mail@eliasnaur.com>
- Loading branch information