mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
shareable: Bug fix: Call SetFinalizer whenever a new image is created
Fixes #637
This commit is contained in:
parent
f765966742
commit
abdf52bc74
@ -277,6 +277,7 @@ func (i *Image) allocate(shareable bool) {
|
||||
i.backend = &backend{
|
||||
restorable: restorable.NewImage(i.width, i.height, false),
|
||||
}
|
||||
runtime.SetFinalizer(i, (*Image).Dispose)
|
||||
return
|
||||
}
|
||||
|
||||
@ -284,6 +285,7 @@ func (i *Image) allocate(shareable bool) {
|
||||
if n, ok := b.TryAlloc(i.width, i.height); ok {
|
||||
i.backend = b
|
||||
i.node = n
|
||||
runtime.SetFinalizer(i, (*Image).Dispose)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user