restorable: Dispose images explicitly when restoring (#567)

This commit is contained in:
Hajime Hoshi 2018-03-24 23:27:08 +09:00
parent 1616373819
commit 0acf021e03

View File

@ -133,8 +133,11 @@ func (i *images) restore() error {
panic("not reached") panic("not reached")
} }
// Framebuffers/textures cannot be disposed since framebuffers/textures that // Dispose image explicitly
// don't belong to the current context. for img := range i.images {
img.image.Dispose()
// img.image can't be set nil here, or Size() panics when restoring.
}
// Let's do topological sort based on dependencies of drawing history. // Let's do topological sort based on dependencies of drawing history.
// It is assured that there are not loops since cyclic drawing makes images stale. // It is assured that there are not loops since cyclic drawing makes images stale.