mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
shareable: Reset finalizer in any cases
This commit is contained in:
parent
1cf4f30541
commit
dff492955d
@ -171,16 +171,16 @@ func (i *Image) Dispose() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) dispose() {
|
func (i *Image) dispose() {
|
||||||
if i.isDisposed() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
i.backend = nil
|
i.backend = nil
|
||||||
i.node = nil
|
i.node = nil
|
||||||
runtime.SetFinalizer(i, nil)
|
runtime.SetFinalizer(i, nil)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
if i.isDisposed() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if i.node == nil {
|
if i.node == nil {
|
||||||
i.backend.restorable.Dispose()
|
i.backend.restorable.Dispose()
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user