Centralize layout unload destruction

This commit is contained in:
2026-06-12 16:49:17 +02:00
parent 7457b06cf9
commit b9b0663546
4 changed files with 10 additions and 2 deletions

View File

@@ -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();
}

View File

@@ -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);
}
};
}