shareable: Reset finalizer in any cases

This commit is contained in:
Hajime Hoshi 2018-04-26 01:51:57 +09:00
parent 1cf4f30541
commit dff492955d

View File

@ -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