From a373e1bf5a2df8437e9837475267d640835bf088 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sun, 18 Oct 2026 01:16:35 +0200 Subject: [PATCH] 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. --- interfaces/ImsdMessages.Ui-Canvas.cppm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/interfaces/ImsdMessages.Ui-Canvas.cppm b/interfaces/ImsdMessages.Ui-Canvas.cppm index 15a8586..198b520 100644 --- a/interfaces/ImsdMessages.Ui-Canvas.cppm +++ b/interfaces/ImsdMessages.Ui-Canvas.cppm @@ -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 window; - Crafter::GraphicsDescriptorHeap heap; std::optional font; Crafter::FontAtlas atlas; + Crafter::GraphicsDescriptorHeap heap; Crafter::UIRenderer ui; std::optional> buildSub; std::optional wrapper;