mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +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")
|
||||
}
|
||||
|
||||
// Framebuffers/textures cannot be disposed since framebuffers/textures that
|
||||
// don't belong to the current context.
|
||||
// Dispose image explicitly
|
||||
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.
|
||||
// It is assured that there are not loops since cyclic drawing makes images stale.
|
||||
|
Loading…
Reference in New Issue
Block a user