mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: bug fix: atomic.Value.Store cannot be called when a differnet type value is already stored
This commit is contained in:
parent
566957dc1c
commit
1cb7633ff6
@ -395,6 +395,8 @@ func (p *playerImpl) readSourceToBuffer() {
|
||||
}
|
||||
|
||||
func (p *playerImpl) setErrorImpl(err error) {
|
||||
if p.err.Load() == nil {
|
||||
p.err.Store(err)
|
||||
}
|
||||
p.closeImpl()
|
||||
}
|
||||
|
@ -185,6 +185,9 @@ func (g *globalState) err() error {
|
||||
}
|
||||
|
||||
func (g *globalState) setError(err error) {
|
||||
if g.err_.Load() != nil {
|
||||
return
|
||||
}
|
||||
g.err_.Store(err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user