~eliasnaur/gio

3fc8f55350da880cf7cd5cc802c37f45f304f0bd — Elias Naur 5 months ago 4c8aa4c
app/internal/wm: [macOS] close display link after window close

The app.Window owner may run SetAnimating just before window close,
which in turn rely on an active display link. This change makes sure
the link is stopped after window close where no more driver calls
can occur.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 2 insertions(+), 1 deletions(-)

M app/internal/wm/os_macos.go
M app/internal/wm/os_macos.go => app/internal/wm/os_macos.go +2 -1
@@ 344,10 344,11 @@ func configFor(scale float32) unit.Metric {
//export gio_onClose
func gio_onClose(view C.CFTypeRef) {
	w := mustView(view)
	w.displayLink.Close()
	w.w.Event(ViewEvent{})
	deleteView(view)
	w.w.Event(system.DestroyEvent{})
	w.displayLink.Close()
	w.displayLink = nil
	C.CFRelease(w.view)
	w.view = 0
	C.CFRelease(w.window)