Fixed some memory leaks and uses of uninitialized values

This commit is contained in:
Yousef Khadadeh 2025-10-11 15:35:17 +03:00
parent 48156cb4bf
commit 0cc326bcc9
12 changed files with 28 additions and 21 deletions

View file

@ -26,7 +26,7 @@ bool TextBoxEditTool::edit_gui(const std::shared_ptr<DrawComponent>& comp) {
t.gui.text_label("Text Color");
});
t.gui.pop_id();
bool editHappened = a->d != oldData;
bool editHappened = (!oldData.has_value()) || (a->d != oldData);
oldData = a->d;
return editHappened;
}