diff --git a/include/frontend.hpp b/include/frontend.hpp index 35a88ad..f6c1513 100755 --- a/include/frontend.hpp +++ b/include/frontend.hpp @@ -59,6 +59,7 @@ std::string save_screen_info(std::string base, const ScreenInfo &info); class TextRectangle { public: TextRectangle(bool font_load_success, sf::Font &text_font); + ~TextRectangle(); enum TextRectangleKind {TEXT_NORMAL, TEXT_SELECTED, TEXT_SUCCESS, TEXT_WARNING, TEXT_ERROR}; void setSize(int width, int height); void setRectangleKind(TextRectangleKind kind); diff --git a/source/TextRectangle.cpp b/source/TextRectangle.cpp index 24d7a96..2458537 100755 --- a/source/TextRectangle.cpp +++ b/source/TextRectangle.cpp @@ -19,6 +19,14 @@ TextRectangle::TextRectangle(bool font_load_success, sf::Font &text_font) { this->reset_data(this->future_data); } +TextRectangle::~TextRectangle() { + delete this->base_bg_color; + delete this->selected_bg_color; + delete this->success_bg_color; + delete this->warning_bg_color; + delete this->error_bg_color; +} + void TextRectangle::setSize(int width, int height) { this->width = width; this->height = height;