From 8855df40e48f3b8127cfb600a24337821d68ee22 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 28 Jul 2016 01:17:57 +0900 Subject: [PATCH] gprahics: Bug fix: Check if an image is disposed before resetting pixels (examples/windowsize crashes) --- image.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() }