mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +01:00
audio: Bug fix: importing audio without NewContext causes error
This commit is contained in:
parent
647d8f0094
commit
61950817fa
@ -167,9 +167,14 @@ var (
|
||||
|
||||
func init() {
|
||||
hooks.AppendHookOnUpdate(func() error {
|
||||
theContext.m.Lock()
|
||||
err := theContext.err
|
||||
theContext.m.Unlock()
|
||||
var err error
|
||||
theContextLock.Lock()
|
||||
if theContext != nil {
|
||||
theContext.m.Lock()
|
||||
err = theContext.err
|
||||
theContext.m.Unlock()
|
||||
}
|
||||
theContextLock.Unlock()
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user