Centralize retained widget node destruction

This commit is contained in:
2026-06-12 16:44:33 +02:00
parent e89d882022
commit 7457b06cf9
4 changed files with 9 additions and 2 deletions

View File

@@ -1778,6 +1778,6 @@ void CanvasModeFloodFill::enter(kCanvasMode prev)
void CanvasModeFloodFill::leave(kCanvasMode next)
{
m_tool->destroy();
pp::panopainter::destroy_legacy_node(*m_tool);
m_tool = nullptr;
}

View File

@@ -1,5 +1,6 @@
#include "pch.h"
#include "log.h"
#include "legacy_ui_overlay_services.h"
#include "node_checkbox.h"
#include "texture.h"
@@ -103,7 +104,7 @@ void NodeCheckBox::set_icon(const std::string& icon_path)
if (icon_path.empty() || !TextureManager::load(icon_path.c_str()))
{
if (m_icon)
m_icon->destroy();
pp::panopainter::destroy_legacy_node(*m_icon);
m_icon = nullptr;
return;
}