mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Fix multiple close for channel (#1047)
This commit is contained in:
parent
55bc2eaa22
commit
6ee587301c
@ -104,6 +104,7 @@ type UserInterface struct {
|
||||
gbuildWidthPx int
|
||||
gbuildHeightPx int
|
||||
setGBuildSizeCh chan struct{}
|
||||
once sync.Once
|
||||
|
||||
context driver.UIContext
|
||||
|
||||
@ -336,7 +337,9 @@ func (u *UserInterface) setGBuildSize(widthPx, heightPx int) {
|
||||
u.gbuildWidthPx = widthPx
|
||||
u.gbuildHeightPx = heightPx
|
||||
u.sizeChanged = true
|
||||
close(u.setGBuildSizeCh)
|
||||
u.once.Do(func() {
|
||||
close(u.setGBuildSizeCh)
|
||||
})
|
||||
u.m.Unlock()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user