mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
fix memory leaks introduced by invalid gettext usage
This commit is contained in:
parent
cd27c8ef5d
commit
98182f6097
14 changed files with 344 additions and 146 deletions
|
@ -113,8 +113,9 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
|
|||
{
|
||||
core::rect<s32> rect(0, 0, 100, 20);
|
||||
rect += v2s32(0, 5) + topleft;
|
||||
Environment->addStaticText(wgettext("World name"),
|
||||
rect, false, true, this, -1);
|
||||
wchar_t* text = wgettext("World name");
|
||||
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||
delete[] text;
|
||||
}
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 300, 30);
|
||||
|
@ -132,8 +133,9 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
|
|||
{
|
||||
core::rect<s32> rect(0, 0, 100, 20);
|
||||
rect += v2s32(0, 40+5) + topleft;
|
||||
Environment->addStaticText(wgettext("Game"),
|
||||
rect, false, true, this, -1);
|
||||
wchar_t* text = wgettext("Game");
|
||||
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||
delete[] text;
|
||||
}
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 300, 80);
|
||||
|
@ -155,14 +157,18 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
|
|||
{
|
||||
core::rect<s32> rect(0, 0, 120, 30);
|
||||
rect = rect + v2s32(170, 140) + topleft;
|
||||
wchar_t* text = wgettext("Create");
|
||||
Environment->addButton(rect, this, GUI_ID_CREATE,
|
||||
wgettext("Create"));
|
||||
text);
|
||||
delete[] text;
|
||||
}
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 120, 30);
|
||||
rect = rect + v2s32(300, 140) + topleft;
|
||||
wchar_t* text = wgettext("Cancel");
|
||||
Environment->addButton(rect, this, GUI_ID_CANCEL,
|
||||
wgettext("Cancel"));
|
||||
text);
|
||||
delete [] text;
|
||||
}
|
||||
changeCtype("C");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue