mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +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) {
|
||||
p.err.Store(err)
|
||||
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