diff --git a/image.go b/image.go index 6203df85a..8573226fb 100644 --- a/image.go +++ b/image.go @@ -162,7 +162,10 @@ func (i *Image) Dispose() error { } func (i *Image) isDisposed() bool { - return i.texture == nil + // i.texture can be nil even when the image is not disposed, + // so we need to check if both are nil. + // See graphicsContext.setSize function. + return i.texture == nil && i.framebuffer == nil } // ReplacePixels replaces the pixels of the image with p.