Fix The rest of UI7 Mem leaks
Throw OneFrame living objs into a pool
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user