ui/app: (macOS) ignore asynchronous redraws to deleted windows

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-19 13:19:35 +02:00
parent 7f5393f9be
commit 6b5714d15d
+6 -2
View File
@@ -98,8 +98,12 @@ func (w *window) setStage(stage Stage) {
// Use a top level func for onFrameCallback to avoid
// garbage from viewDo.
func onFrameCmd(views viewMap, view C.CFTypeRef) {
w := views[view]
w.draw(false)
// CVDisplayLink does not run on the main thread,
// so we have to ignore requests to windows being
// deleted.
if w, exists := views[view]; exists {
w.draw(false)
}
}
//export gio_onFrameCallback