mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 12:08:58 +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.
|
// This function is concurrent-safe.
|
||||||
func (i *Image) Dispose() error {
|
func (i *Image) Dispose() error {
|
||||||
if err := theImagesForRestoring.resetPixelsIfDependingOn(i, glContext()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if i.impl.isDisposed() {
|
if i.impl.isDisposed() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if err := theImagesForRestoring.resetPixelsIfDependingOn(i, glContext()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return i.impl.Dispose()
|
return i.impl.Dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user