fix(color): memory leak in setup pages (#5185)
This commit is contained in:
@@ -63,6 +63,11 @@ class TabCarouselButton : public ButtonBase
|
|||||||
show(isVisible());
|
show(isVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~TabCarouselButton()
|
||||||
|
{
|
||||||
|
delete pageTab;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(DEBUG_WINDOWS)
|
#if defined(DEBUG_WINDOWS)
|
||||||
std::string getName() const override
|
std::string getName() const override
|
||||||
{
|
{
|
||||||
@@ -89,8 +94,7 @@ class TabCarouselButton : public ButtonBase
|
|||||||
show(isVisible());
|
show(isVisible());
|
||||||
if (lastIcon != getIcon()) {
|
if (lastIcon != getIcon()) {
|
||||||
lastIcon = getIcon();
|
lastIcon = getIcon();
|
||||||
icon->deleteLater();
|
icon->setIcon(lastIcon);
|
||||||
icon = new StaticIcon(this, 2, ICON_Y, lastIcon, COLOR_THEME_PRIMARY2);
|
|
||||||
}
|
}
|
||||||
ButtonBase::checkEvents();
|
ButtonBase::checkEvents();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ class PageTab
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool isVisible() const { return true; }
|
|
||||||
|
|
||||||
virtual ~PageTab() = default;
|
virtual ~PageTab() = default;
|
||||||
|
|
||||||
|
virtual bool isVisible() const { return true; }
|
||||||
|
|
||||||
virtual void build(Window* window) = 0;
|
virtual void build(Window* window) = 0;
|
||||||
|
|
||||||
virtual void checkEvents() {}
|
virtual void checkEvents() {}
|
||||||
|
|||||||
+3
-3
@@ -167,9 +167,9 @@ void StaticIcon::setColor(LcdColorIndex color)
|
|||||||
|
|
||||||
void StaticIcon::setIcon(EdgeTxIcon icon)
|
void StaticIcon::setIcon(EdgeTxIcon icon)
|
||||||
{
|
{
|
||||||
auto mask = getBuiltinIcon(icon);
|
auto newMask = getBuiltinIcon(icon);
|
||||||
setSize(mask->width, mask->height);
|
setSize(newMask->width, newMask->height);
|
||||||
lv_canvas_set_buffer(lvobj, (void*)mask->data, mask->width, mask->height,
|
lv_canvas_set_buffer(lvobj, (void*)newMask->data, newMask->width, newMask->height,
|
||||||
LV_IMG_CF_ALPHA_8BIT);
|
LV_IMG_CF_ALPHA_8BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user