graphcis: Bug fix: Evacuating/Restoring pixels must be ignored on a disposed image

This commit is contained in:
Hajime Hoshi 2016-05-17 01:30:13 +09:00
parent 18c14f8897
commit 75b7a9134d

View File

@ -324,6 +324,9 @@ func (i *imageImpl) evacuatePixels() error {
if i.defaultFramebuffer { if i.defaultFramebuffer {
return nil return nil
} }
if i.disposed {
return nil
}
if i.evacuated { if i.evacuated {
return errors.New("ebiten: image must not be evacuated") return errors.New("ebiten: image must not be evacuated")
} }
@ -358,6 +361,9 @@ func (i *imageImpl) restorePixels() error {
if i.defaultFramebuffer { if i.defaultFramebuffer {
return nil return nil
} }
if i.disposed {
return nil
}
if !i.evacuated { if !i.evacuated {
return errors.New("ebiten: image must be evacuated") return errors.New("ebiten: image must be evacuated")
} }