mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +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() {
|
func init() {
|
||||||
hooks.AppendHookOnUpdate(func() error {
|
hooks.AppendHookOnUpdate(func() error {
|
||||||
theContext.m.Lock()
|
var err error
|
||||||
err := theContext.err
|
theContextLock.Lock()
|
||||||
theContext.m.Unlock()
|
if theContext != nil {
|
||||||
|
theContext.m.Lock()
|
||||||
|
err = theContext.err
|
||||||
|
theContext.m.Unlock()
|
||||||
|
}
|
||||||
|
theContextLock.Unlock()
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user