From 0ff6dc3112309f231291ea80c84c3d4a325b134c Mon Sep 17 00:00:00 2001 From: Tristan Cormier Date: Thu, 20 Nov 2025 09:32:31 -0500 Subject: [PATCH] feat(console): add CONSOLELINE destructor --- src/console/Screen.cpp | 10 ++++++++++ src/console/Screen.hpp | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/console/Screen.cpp b/src/console/Screen.cpp index b0816d2..4eed1e9 100644 --- a/src/console/Screen.cpp +++ b/src/console/Screen.cpp @@ -40,6 +40,16 @@ static CImVector s_colorArray[] = { { 0x00, 0x00, 0x00, 0xC0 }, // BACKGROUND_COLOR }; +CONSOLELINE::~CONSOLELINE() { + if (this->buffer) { + STORM_FREE(this->buffer); + } + + if (this->fontPointer) { + GxuFontDestroyString(this->fontPointer); + } +} + void DrawBackground() { uint16_t indices[] = { 0, 1, 2, 3 diff --git a/src/console/Screen.hpp b/src/console/Screen.hpp index 787d1b9..3d33654 100644 --- a/src/console/Screen.hpp +++ b/src/console/Screen.hpp @@ -16,6 +16,9 @@ class CONSOLELINE : public TSLinkedNode { uint32_t inputstart; COLOR_T colorType; CGxString* fontPointer; + + // Member functions + ~CONSOLELINE(); }; void ConsoleScreenAnimate(float elapsedSec);