mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +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 {
|
||||
r := false
|
||||
u := currentUI
|
||||
_ = u.runOnMainThread(func() error {
|
||||
r = currentUI.vsync
|
||||
return nil
|
||||
})
|
||||
u.m.Lock()
|
||||
r := u.vsync
|
||||
u.m.Unlock()
|
||||
return r
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user