From e9d061964139e0591fe75ba38f73774f567f2a25 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 22 Aug 2023 11:51:16 -0600 Subject: [PATCH] app: [macOS] stop display after any events that may access it Fixes: https://todo.sr.ht/~eliasnaur/gio/527 Signed-off-by: Elias Naur --- app/os_macos.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/os_macos.go b/app/os_macos.go index 5d07b756..f9f6baa2 100644 --- a/app/os_macos.go +++ b/app/os_macos.go @@ -788,13 +788,13 @@ 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 + deleteView(view) C.CFRelease(w.view) w.view = 0 - w.displayLink = nil } //export gio_onHide