Move to more memory safe implementation of widget holding
This commit is contained in:
@@ -262,7 +262,7 @@ void WidgetText::draw()
|
||||
SDL_FreeSurface(txt_surface);
|
||||
}
|
||||
|
||||
Widget* WidgetText::builder(const nlohmann::json& j)
|
||||
std::unique_ptr<Widget> WidgetText::builder(const nlohmann::json& j)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
@@ -299,7 +299,7 @@ Widget* WidgetText::builder(const nlohmann::json& j)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new WidgetText(x, y, width, height,
|
||||
return std::make_unique<WidgetText>(x, y, width, height,
|
||||
text, fit, should_wrap,
|
||||
halign, valign,
|
||||
halign_via_visible, valign_via_visible,
|
||||
|
||||
Reference in New Issue
Block a user