mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
restorable: Dispose images explicitly when restoring (#567)
This commit is contained in:
parent
1616373819
commit
0acf021e03
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user