diff --git a/image.go b/image.go index b75c1f3dd..6ffbfd49f 100644 --- a/image.go +++ b/image.go @@ -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() }