Ui: destroy the descriptor heap before the font atlas
Crafter.Graphics's FontAtlas now destroys its image when it goes. In sets mode the heap holds a view of that image, so the heap must go first: the atlas is declared before the heap, and dies after it.
This commit is contained in:
parent
20e687452f
commit
a373e1bf5a
1 changed files with 5 additions and 4 deletions
|
|
@ -128,13 +128,14 @@ export namespace ImsdMessages::Ui {
|
|||
class Canvas {
|
||||
// Declared first so they die last: a layer's buffer slots hand their
|
||||
// numbers back to the heap when they go, so the heap (and the
|
||||
// renderer, which holds slots of its own) must still exist then.
|
||||
// Members are destroyed in the reverse order of their declaration,
|
||||
// whatever their access.
|
||||
// renderer, which holds slots of its own) must still exist then. The
|
||||
// atlas destroys its image and the heap, in sets mode, holds a view
|
||||
// of it, so the heap goes before the atlas. Members are destroyed in
|
||||
// the reverse order of their declaration, whatever their access.
|
||||
std::optional<Crafter::Window> window;
|
||||
Crafter::GraphicsDescriptorHeap heap;
|
||||
std::optional<Crafter::Font> font;
|
||||
Crafter::FontAtlas atlas;
|
||||
Crafter::GraphicsDescriptorHeap heap;
|
||||
Crafter::UIRenderer ui;
|
||||
std::optional<Crafter::EventListener<Crafter::UIBuildArgs>> buildSub;
|
||||
std::optional<WordWrapper> wrapper;
|
||||
|
|
|
|||
Loading…
Reference in a new issue