graphics: Bug fix: Invalid Clear calling in Dispose

This commit is contained in:
Hajime Hoshi 2016-09-03 23:42:28 +09:00
parent fb3724a40e
commit cae75fac69
2 changed files with 7 additions and 1 deletions

View File

@ -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
} }

View File

@ -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
} }