mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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
|
||||
}
|
||||
i.disposed = true
|
||||
i.restorable.Clear()
|
||||
runtime.SetFinalizer(i, nil)
|
||||
return nil
|
||||
}
|
||||
|
@ -249,6 +249,13 @@ func (p *Image) Recreate(width, height int, filter opengl.Filter) error {
|
||||
}
|
||||
|
||||
func (p *Image) Dispose() error {
|
||||
if err := p.image.Dispose(); err != nil {
|
||||
return err
|
||||
}
|
||||
p.image = nil
|
||||
p.basePixels = nil
|
||||
p.baseColor = color.RGBA{}
|
||||
p.drawImageHistory = nil
|
||||
p.stale = false
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user