uidriver/glfw: Ensure that canceling happens after all the queued tasks are done

This commit is contained in:
Hajime Hoshi 2020-08-29 23:27:20 +09:00
parent deb3d4a0c3
commit 1ed2b09ba0

View File

@ -606,7 +606,13 @@ func (u *UserInterface) Run(uicontext driver.UIContext) error {
ch := make(chan error, 1) ch := make(chan error, 1)
go func() { go func() {
defer cancel() defer func() {
_ = u.t.Call(func() error {
cancel()
return nil
})
}()
defer close(ch) defer close(ch)
if err := u.run(); err != nil { if err := u.run(); err != nil {
ch <- err ch <- err