mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Bug fix: IsVsyncEnabled can cause deadlock
This commit is contained in:
parent
b4a4b87b56
commit
34596bb1cf
@ -350,12 +350,10 @@ func SetVsyncEnabled(enabled bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsVsyncEnabled() bool {
|
func IsVsyncEnabled() bool {
|
||||||
r := false
|
|
||||||
u := currentUI
|
u := currentUI
|
||||||
_ = u.runOnMainThread(func() error {
|
u.m.Lock()
|
||||||
r = currentUI.vsync
|
r := u.vsync
|
||||||
return nil
|
u.m.Unlock()
|
||||||
})
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user