gprahics: Bug fix: Check if an image is disposed before resetting pixels (examples/windowsize crashes)

This commit is contained in:
Hajime Hoshi 2016-07-28 01:17:57 +09:00
parent 5e1ed99e2e
commit 8855df40e4

View File

@ -222,12 +222,12 @@ func (i *Image) At(x, y int) color.Color {
//
// This function is concurrent-safe.
func (i *Image) Dispose() error {
if err := theImagesForRestoring.resetPixelsIfDependingOn(i, glContext()); err != nil {
return err
}
if i.impl.isDisposed() {
return nil
}
if err := theImagesForRestoring.resetPixelsIfDependingOn(i, glContext()); err != nil {
return err
}
return i.impl.Dispose()
}