diff --git a/internal/shareable/shader.go b/internal/shareable/shader.go index 4c4025994..6f13ae348 100644 --- a/internal/shareable/shader.go +++ b/internal/shareable/shader.go @@ -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 }