diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index 4405427e9..a081d8b61 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -606,7 +606,13 @@ func (u *UserInterface) Run(uicontext driver.UIContext) error { ch := make(chan error, 1) go func() { - defer cancel() + defer func() { + _ = u.t.Call(func() error { + cancel() + return nil + }) + }() + defer close(ch) if err := u.run(); err != nil { ch <- err