mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +01:00
internal/atlas: add comments
This commit is contained in:
parent
9ee56ac320
commit
5290605b2d
@ -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.
|
// A function from finalizer must not be blocked, but disposing operation can be blocked.
|
||||||
// Defer this operation until it becomes safe. (#913)
|
// Defer this operation until it becomes safe. (#913)
|
||||||
func (i *Image) MarkDisposed() {
|
func (i *Image) MarkDisposed() {
|
||||||
|
// As MarkDisposed can be invoked from finalizers, backendsM should not be used.
|
||||||
deferredM.Lock()
|
deferredM.Lock()
|
||||||
deferred = append(deferred, func() {
|
deferred = append(deferred, func() {
|
||||||
i.dispose(true)
|
i.dispose(true)
|
||||||
|
@ -42,6 +42,7 @@ func NewShader(ir *shaderir.Program) *Shader {
|
|||||||
// A function from finalizer must not be blocked, but disposing operation can be blocked.
|
// A function from finalizer must not be blocked, but disposing operation can be blocked.
|
||||||
// Defer this operation until it becomes safe. (#913)
|
// Defer this operation until it becomes safe. (#913)
|
||||||
func (s *Shader) MarkDisposed() {
|
func (s *Shader) MarkDisposed() {
|
||||||
|
// As MarkDisposed can be invoked from finalizers, backendsM should not be used.
|
||||||
deferredM.Lock()
|
deferredM.Lock()
|
||||||
deferred = append(deferred, func() {
|
deferred = append(deferred, func() {
|
||||||
s.dispose()
|
s.dispose()
|
||||||
|
Loading…
Reference in New Issue
Block a user