mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-09-07 08:05:16 -05:00
Prevent non-freed memory
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user