Fix The rest of UI7 Mem leaks

Throw OneFrame living objs into a pool
This commit is contained in:
2026-09-05 18:06:59 +02:00
parent fc5a357caa
commit d18e397eaf
9 changed files with 122 additions and 49 deletions
+4 -2
View File
@@ -161,7 +161,8 @@ PD_API void Layout::Update() {
PD_API void Layout::Label(const std::string& label) {
// Layout API
auto r = new UI7::Label(label, IO);
auto r = IO.LabelPool.Allocate();
*r = UI7::Label(label, IO);
r->SetClipRect(fvec4(GetPosition(), GetPosition() + GetSize()));
AddObject(r);
}
@@ -192,7 +193,8 @@ PD_API void Layout::Checkbox(const std::string& label, bool& v) {
}
PD_API void Layout::Image(Li::Texture img, fvec2 size, Li::Rect uv) {
Container* r = new UI7::Image(img, size, uv);
auto r = IO.ImagePool.Allocate();
*r = UI7::Image(img, size, uv);
AddObject(r);
}