audio: Bug fix: importing audio without NewContext causes error

This commit is contained in:
Hajime Hoshi 2018-03-04 22:18:14 +09:00
parent 647d8f0094
commit 61950817fa

View File

@ -167,9 +167,14 @@ var (
func init() { func init() {
hooks.AppendHookOnUpdate(func() error { hooks.AppendHookOnUpdate(func() error {
var err error
theContextLock.Lock()
if theContext != nil {
theContext.m.Lock() theContext.m.Lock()
err := theContext.err err = theContext.err
theContext.m.Unlock() theContext.m.Unlock()
}
theContextLock.Unlock()
return err return err
}) })
} }