mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 19:58:54 +01:00
uidriver/glfw: Ensure that canceling happens after all the queued tasks are done
This commit is contained in:
parent
deb3d4a0c3
commit
1ed2b09ba0
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user