mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphics: Bug fix: Invalid Clear calling in Dispose
This commit is contained in:
parent
fb3724a40e
commit
cae75fac69
@ -269,7 +269,6 @@ func (i *imageImpl) Dispose() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
i.disposed = true
|
i.disposed = true
|
||||||
i.restorable.Clear()
|
|
||||||
runtime.SetFinalizer(i, nil)
|
runtime.SetFinalizer(i, nil)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,13 @@ func (p *Image) Recreate(width, height int, filter opengl.Filter) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Image) Dispose() error {
|
func (p *Image) Dispose() error {
|
||||||
|
if err := p.image.Dispose(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
p.image = nil
|
p.image = nil
|
||||||
|
p.basePixels = nil
|
||||||
|
p.baseColor = color.RGBA{}
|
||||||
|
p.drawImageHistory = nil
|
||||||
|
p.stale = false
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user