internal/atlas: add comments

This commit is contained in:
Hajime Hoshi 2022-06-08 11:18:08 +09:00
parent 9ee56ac320
commit 5290605b2d
2 changed files with 2 additions and 0 deletions

View File

@ -656,6 +656,7 @@ func (i *Image) at(graphicsDriver graphicsdriver.Graphics, x, y int) (byte, byte
// A function from finalizer must not be blocked, but disposing operation can be blocked.
// Defer this operation until it becomes safe. (#913)
func (i *Image) MarkDisposed() {
// As MarkDisposed can be invoked from finalizers, backendsM should not be used.
deferredM.Lock()
deferred = append(deferred, func() {
i.dispose(true)

View File

@ -42,6 +42,7 @@ func NewShader(ir *shaderir.Program) *Shader {
// A function from finalizer must not be blocked, but disposing operation can be blocked.
// Defer this operation until it becomes safe. (#913)
func (s *Shader) MarkDisposed() {
// As MarkDisposed can be invoked from finalizers, backendsM should not be used.
deferredM.Lock()
deferred = append(deferred, func() {
s.dispose()