mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
ui/app: (macOS) ignore asynchronous redraws to deleted windows
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+6
-2
@@ -98,8 +98,12 @@ func (w *window) setStage(stage Stage) {
|
|||||||
// Use a top level func for onFrameCallback to avoid
|
// Use a top level func for onFrameCallback to avoid
|
||||||
// garbage from viewDo.
|
// garbage from viewDo.
|
||||||
func onFrameCmd(views viewMap, view C.CFTypeRef) {
|
func onFrameCmd(views viewMap, view C.CFTypeRef) {
|
||||||
w := views[view]
|
// CVDisplayLink does not run on the main thread,
|
||||||
w.draw(false)
|
// so we have to ignore requests to windows being
|
||||||
|
// deleted.
|
||||||
|
if w, exists := views[view]; exists {
|
||||||
|
w.draw(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//export gio_onFrameCallback
|
//export gio_onFrameCallback
|
||||||
|
|||||||
Reference in New Issue
Block a user