From b9b06635467422376f4e00acf3ee3d9754e501c3 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 12 Jun 2026 16:49:17 +0200 Subject: [PATCH] Centralize layout unload destruction --- docs/modernization/debt.md | 5 +++++ docs/modernization/roadmap.md | 2 ++ src/layout.cpp | 3 ++- src/legacy_ui_overlay_services.h | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 51d9975..22cc202 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -588,6 +588,11 @@ agent or engineer to remove them without reconstructing context from chat. checkbox icon removal now route retained node destruction through `src/legacy_ui_overlay_services.*`. The underlying `Node` tree still exposes raw child pointers and public destroy state. +- 2026-06-12: DEBT-0063 was narrowed again. Layout unload root destruction and + popup tick-overlay close callbacks now route retained node destruction through + `src/legacy_ui_overlay_services.*`. `Node::destroy()` itself remains the + compatibility boundary until checked tree handles replace raw parent/child + mutation. - 2026-06-05: DEBT-0011 was narrowed. The Windows app package smoke target now passes the configure-time CMake executable into `package-smoke.ps1`, so VS 2026 generator validation does not depend on an older `cmake` on PATH, and diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 2702fc8..70dee25 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -537,6 +537,8 @@ Legacy document-open import/discard prompts and brush-package export completion now route retained dialog closing through the same helper. Flood-fill tool teardown and checkbox icon removal now route retained node destruction through that helper as well. +Layout unload root destruction and popup tick-overlay close callbacks now route +retained node destruction through that helper. Raw popup callback captures and full close/capture ownership remain part of `DEBT-0063`. `pano_cli inspect-image` exposes PNG IHDR metadata as JSON, diff --git a/src/layout.cpp b/src/layout.cpp index 63b5793..5804b14 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -4,13 +4,14 @@ #include "asset.h" #include "node.h" #include "node_border.h" +#include "legacy_ui_overlay_services.h" #include "layout.h" #include "platform_api/asset_file_load_policy.h" void LayoutManager::unload() { for (auto& l : m_layouts) - l.second->destroy(); + pp::panopainter::destroy_legacy_node(*l.second); m_layouts.clear(); } diff --git a/src/legacy_ui_overlay_services.h b/src/legacy_ui_overlay_services.h index 3d80cbe..ad2c66f 100644 --- a/src/legacy_ui_overlay_services.h +++ b/src/legacy_ui_overlay_services.h @@ -74,7 +74,7 @@ void bind_legacy_popup_close_destroys_overlay( { popup.on_popup_close = [overlay](Node*) { if (overlay) { - overlay->destroy(); + destroy_legacy_node(*overlay); } }; }