shareable: Allow multiple call of (*Shader).Dispose

This commit is contained in:
Hajime Hoshi 2020-05-29 03:47:06 +09:00
parent 9c637c65be
commit 18c59e44aa

View File

@ -47,6 +47,10 @@ func (s *Shader) MarkDisposed() {
}
func (s *Shader) dispose() {
runtime.SetFinalizer(s, nil)
if s.shader == nil {
return
}
s.shader.Dispose()
s.shader = nil
}