mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
gprahics: Bug fix: Check if an image is disposed before resetting pixels (examples/windowsize crashes)
This commit is contained in:
parent
5e1ed99e2e
commit
8855df40e4
6
image.go
6
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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user