restorable: Bug fix: Unlocking should happen after restoring

This commit is contained in:
Hajime Hoshi 2019-08-12 23:00:37 +09:00
parent 1f66c155ae
commit 9dd501720e

View File

@ -78,13 +78,15 @@ func RestoreIfNeeded() error {
//
// Between each frame, any image operations are not permitted, or stale images would remain when restoring
// (#913).
firsttime := false
theImages.once.Do(func() {
firsttime = true
})
if !firsttime {
theImages.m.Unlock()
}
defer func() {
firsttime := false
theImages.once.Do(func() {
firsttime = true
})
if !firsttime {
theImages.m.Unlock()
}
}()
if !needsRestoring() {
return nil