graphicsdriver/metal: Do not release a nil texture (screen)

This commit is contained in:
Hajime Hoshi 2019-02-22 00:30:36 +09:00
parent 6c47e31f49
commit f19d7a29b8

View File

@ -698,7 +698,10 @@ func (i *Image) viewportSize() (int, int) {
func (i *Image) Dispose() {
mainthread.Run(func() error {
i.texture.Release()
if i.texture != (mtl.Texture{}) {
i.texture.Release()
i.texture = mtl.Texture{}
}
return nil
})
}