forked from joejulian/gio
1527e91a02
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>