From 26b532c92642f09b4f1af5a0310ca27cc65938a9 Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Fri, 23 Aug 2024 21:31:10 +0200 Subject: [PATCH] Fix UIWindowTitleBar --- src/kekengine/cpp/ui/uielements.cpp | 7 +++++++ src/kekengine/include/uielements.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/kekengine/cpp/ui/uielements.cpp b/src/kekengine/cpp/ui/uielements.cpp index df06f92..08fbdc5 100644 --- a/src/kekengine/cpp/ui/uielements.cpp +++ b/src/kekengine/cpp/ui/uielements.cpp @@ -349,6 +349,11 @@ UIWindowTitleBar::UIWindowTitleBar(UIValue height) addChild(closeButton); } +UIWindowTitleBar::~UIWindowTitleBar() { + delete text; + delete closeButton; +} + void UIWindowTitleBar::dragEnter(UIPoint pos, UIPoint screenPos) { // TODO } @@ -380,6 +385,8 @@ UIWindow::UIWindow(UIValue x, UIValue y, UIValue w, UIValue h) } UIWindow::~UIWindow() { + delete background; + delete titleBar; } UIElementType UIWindow::getType() { diff --git a/src/kekengine/include/uielements.h b/src/kekengine/include/uielements.h index c4f2799..fae0961 100644 --- a/src/kekengine/include/uielements.h +++ b/src/kekengine/include/uielements.h @@ -132,6 +132,8 @@ class UIWindowTitleBar: public RectangleElement { UIWindowTitleBar(UIValue height); + virtual ~UIWindowTitleBar(); + virtual void dragEnter(UIPoint pos, UIPoint screenPos); virtual void drag(UIPoint pos, UIPoint screenPos); virtual void dragExit(UIPoint pos, UIPoint screenPos);